Results 1 to 2 of 2

Thread: Datatype problem

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    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

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    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
  •  



Click Here to Expand Forum to Full Width