|
-
Oct 20th, 2003, 03:38 AM
#1
Thread Starter
Frenzied Member
Datatype problem
I am using Infragistics webgrid control (an extremly good control btw) for displaying data, and I am now trying to add a checkbox column. I have found a Knowledgebase article that explains how this is done:
UltraWebGrid1.DisplayLayout.Bands(0).Columns.Add("Unbound")
UltraWebGrid1.DisplayLayout.Bands(0).Columns("Unbound").DataType = System.Type.GetType("Boolean")
UltraWebGrid1.DisplayLayout.Bands(0).Columns("Unbound").Type = Infragistics.WebUI.UltraWebGrid.ColumnType.CheckBox
Extremy logically... but it has errors
1) Since I use Option Strict = On, I get error on Columns.Add("Unbound") saying a string can't be converted to integer. How do I handle this????
2)UltraWebGrid1.DisplayLayout.Bands(0).Columns("Unbound").DataType = System.Type.GetType("Boolean")
Here I get runtime error saying that "Input string was not in a correct format."
On the left it expects a string, but on the right I am getting a "Type" - datatype. I tried the toString() but still got the same message....
How do I handle these problems? I find it remarkable that they write this code in Knowledge base articles...
http://www.infragistics.com/support/...?article=01093
kind regards
Henrik
-
Oct 20th, 2003, 09:13 AM
#2
Frenzied Member
1) Since I use Option Strict = On, I get error on Columns.Add("Unbound") saying a string can't be converted to integer. How do I handle this????
Since you are using Option Strict (which doesn't allow implicit narrowing of data types) you would need to explicitly convert the integer to a string...
Code:
int a = 16;
string b = (string)a; // explicity converts/casts the integer to a string.
2. you would need to verify what format their method is expecting and then check to see how the string you are passing is formatted.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|