Double click event of datagrid

jenny80

New member
Joined
May 17, 2006
Messages
1
Programming Experience
Beginner
I am a VB.NEt Newbee

I am using VB language
Microsoft .Net Framework 1.0
Windows xp
SQL Server
Kindly help me to solve the following
1) When I double click a particular row in the datagrid, I need to recognize the row value

2) When a field has null value in the database, i do not want the datagrid to display (null) ..I need it to be blank
3) When i try to bind a dataset field which had null value to a text box it gives error "

An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll. Additional information: Cast from type 'DBNull' to type 'String' is not valid.

Thanks in advance

Regards
 
Howdy, just a question: Are you using Visual Studio 2003? If you are then I really recommend you upgrade. Try and get hold of VS 2005 if you can. I think you can download VB Express edition or something similar. In your case, it will allow you to use Framework 2's DataGridView which is MUCH easier to use and much more powerful.

2) I'm not sure if you can do this. You could manually iterate through the cells of your DataGrid and set the values to appear blank. Like, if the cell should hold a String, set the value to " ".

3) This would be solved if you did what I mentioned above, by setting the value to " ". I've only ever used databinding with Delphi so I'm not sure, but I try not to use it. It is faster and easier, but its problems like you're having that put me off. Are you manually creating the datasource for your datagrid? or are you retrieving information from a database? If you are manually creating it, when you do, set the values to some non-null value. If you are reading from a database, set the 'default value' property for each field.

I'm kinda preoccupied at the moment so my response is probably terrible but I'm sure that other people here can be of help
 
Back
Top