Jump to content
Xtreme .Net Talk

Duckjibe

Members
  • Posts

    15
  • Joined

  • Last visited

Personal Information

  • Occupation
    Hardware developer trainee

Duckjibe's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. No what i whant is that the coloum in my Grid which is called "datasheets" can have a hyperlink to a local folder so that when i click in the cell on the link a PDF file will open or the folder is opening...
  2. Searched a lot but didnt find anything !!!!!!!! Isn't it possible to have a link coloum in a windows form datagrid? I want to browse to a localfolder. The path is displayed in the datagrid. Any suggestions? Duckjibe360
  3. private void Form1_Load(object sender, System.EventArgs e) { string Serverpath; try { // Create an instance of StreamReader to read from a file. // The using statement also closes the StreamReader. using(StreamReader sr = new StreamReader("Serverpath.txt")) { Serverpath = sr.ReadLine(); } setpath(Serverpath); } catch(Exception ex) { MessageBox.Show("File Could not be Read " + ex); } } private void setpath(string str) { Data_Connection.DataSource = str; } I just want to change the datasource cause the user want to place the database a location(server) i dont know yet! So im writing userinput to a file and reading it at formload. My problem is that when i compile it says Property or indexer 'System.Data.OleDb.OleDbConnection.DataSource' cannot be assigned to -- it is read only How do i avoid this??? How can i change the datasource location at runtime??? Please help!
  4. I deployed a program yesterday and had the same proplem requires mdac ver2.6 and above. I installed 2.7 over my 2.5 and it wasnt a problem then.... so i think just install 2.7!
  5. either its me thats an totaly idiot or its me.... i want to deploy a tiny little program. but i want to install it to C:/ProductName..... I can do [ProgramFilesFolder][ProductName] thats fine no problem but when i remove [ProgramFilesFolder] i get an error under installation Networkpath..productName could not be accesed... Why is it sudenly a networkpath? what am i missing to tell??? Please help Thanks
  6. How can i then get a function that allows to select a path instead of a file? My purpose is to throw this path in a database and use it lateron as a linkcolumn for Datasheetlinks! is there a way to do it????
  7. Hi Guys,Okay, I think I've figured out that System.Web.UI.HtmlControls.HtmlInputControl does NOT let me configure it to return a user-selected folder, only files. is it possible to set the control to allow just to browse to a specified folder ? It would be nice if my user didn't have to type in the path everytime. If there isnot, does anyone have any code for a function to do so??? Would be very happy over any help;-) Bye
  8. no thats why i cant understand it!!!!!!!
  9. Hey guys actually my webform is working fine i can edit my datagrid and update my dataset.... But a problem i ran in to that i havent worked out is that when i search in my database/table i fill my dataset and get a result. Lets say i found to records and want to edit one of the found record. But when i click my edit link it refills my dataset and edits the item at the specified Index but that is not the found record.... cause the refill of the dataset.... hope someone has understood what i mean! i am not editing the found record but the record at (index1) in the table..... thats actually cause i am using private void Edit_command(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { DataGrid1.EditItemIndex = e.Item.ItemIndex; originalvalue = e.Item.Cells[1].Text; Linkvalue = e.Item.Cells[8].Text; Label1.Visible = true; TextBox1.Visible = true; TextBox1.Text = Linkvalue; BindGrid(); } how can i work around or Avoid that problem??? How can i find out which row i clicked on? thanks a lot!
  10. Hello found some snippets but coudlnt figure out how to use it the code is written in VB and i am using C# thats not the problem, but i get an message that the type is read only ??? anyone knows how to edit the textboxes in runtime... i am not using template columns rather i use boundColumns... I want to set properties of the textboxes programatically. For example: If ((e.Item.ItemType = ListItemType.EditItem) then dim tb as TextBox tb = e.Item.FindControl("txtBox") tb.Font = valid font info object tb.Style = "valid style setting string" tb.Width = whatever End If ???????????
  11. hey got a little problem how can it be so hard to sort your datagrid either ascending or descending i tried hard to find it on the net but didnt find that what i wanted / needed. I have a normal datagrid bound to a dataview. I can sort the grid but just the simple way one click... i have some code here that finds out if it has to be ascending or descending bút i htink i have to implement some Icomparer class or so but i have noot figured out! Maybe one knows where to find snippets, tutorials or could help me wiht my code! protected string SortColumn { get { object o = ViewState["SortColumn"]; if (o != null) { return (string) o; } return "Part_number"; //default } set { ViewState["SortColumn"] = value; } } protected bool SortAscend { get { object o = ViewState["SortAscend"]; if (o != null) return(bool)o; return true; } set { ViewState["SortAscend"] = value; } } private void Sorting(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e) { string currentSortColumn = SortColumn; SortColumn = e.SortExpression.ToString(); if (currentSortColumn == e.SortExpression) { SortAscend = !SortAscend; } else { SortAscend = true; } BindGrid(); } Hope to find some help here;-) thanks
  12. I figured it out! But thanks for your reply!
  13. Hey folks got a problem i cant understand first i shortly try to explain my prog... I got two datagrids the first is to display what has been retrived by a selectcommand from a dataset. The other dataset is to display data that is "bound" to the selected row in datagrid1.. e.g i search in my dataset all machines that are located at "elmstreet":-) in the first datagrid there would come thre machines machine 1, serialnr 23423 machine 2, serialnr 23424 machine 3, serialnr 23425 now i click on (rowheader0) machine1 and want to se some data in datagrid 2. here is my code Dim auswahl Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '/*Form_Load fills the dataset "PAGeraete" with all entries in the database Table "PAGeraete"! Sets The Data ' source for the Datagrid1 Try GeraeteAdapter.SelectCommand.Parameters.Clear() GeraeteAdapter.SelectCommand.CommandText = "SELECT GeraeteID, GeraeteTyp, Standort, [LA-Nr], [DM-Nr], Flasche1, Flasche2, Bodyguard, Hersteller, Indienst FROM(PAGeraete) ORDER BY GeraeteID" DataGrid1.DataSource = (PAGeraete1.PAGeraete) PAGeraete1.Clear() GeraeteAdapter.Fill(PAGeraete1) Catch fillexception As System.Exception MsgBox("Exception Caught: " & fillexception.Message) End Try OleDbConnection2.Open() DatenAdapter.SelectCommand.Parameters("Geraetenr").Value = 1 OleDbSelectCommand2.ExecuteNonQuery() DataGrid2.DataSource = (PaDaten1.PADaten) PaDaten1.Clear() DatenAdapter.Fill(PaDaten1) OleDbConnection2.Close() End Sub 'Form1_Load Private Sub Datagrid1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.Click Try auswahl = DataGrid1(DataGrid1.CurrentRowIndex, 0) Catch e1 As System.IndexOutOfRangeException MsgBox("Thisis caught an error: " & e1.Message) MessageBox.Show(auswahl) End Try Datafill() End Sub im filling datagrid1 and it works fine but when i search an fill datagrid1 again i got this error ************** Exception Text ************** System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Windows.Forms.DataGrid.Edit(String instantText) at System.Windows.Forms.DataGrid.Edit() at System.Windows.Forms.DataGrid.OnEnter(EventArgs e) at System.Windows.Forms.Control.NotifyEnter() at System.Windows.Forms.ContainerControl.UpdateFocusedControl() when i continue everything runs fine with no error! ???? I dont know where it goes wrong! I have the zipped the applikation maybe soemone knows how to fix it! atemschutzkartei.ace
  14. Hello i got a problem to get the value from a cell in the Datagrid! I got an searchoption to fill my datagrid..... now the user has to select item he wants to se more about. The value is always stored in Column0 but the rows are always different. I know how to get the value from a specified Cell like Value = DataGrid1.Item(0, 0) but it isnt always 0, 0 it could also be 1, 0 or something!! so what can i do I also found something here You can do this for column number.... MessageBox.Show(myGrid1.CurrentCell.ColumnNumber.ToString) Row number... MessageBox.Show(myGrid1.CurrentCell.RowNumber.ToString) Both row and column (as string) MessageBox.Show(myGrid1.CurrentCell.ToString) But the string i get doesnt contain the value of the field just where i selected!!!!! I love to hate programming:D Thanks for any advice! Bye
  15. Hey started with vb.net this morning Looks like advancet one:-)... First problem is how to connect to a simple accesdatabase?? Or is it that they dont support access bases any longer...?? Thanks
×
×
  • Create New...