DataRowView

csharp United States
  • 18 years ago

    Hi All,


    I m new to C# so my question is also vert elementary. I have a datagrid. I have trapped the 'OnItemCreated' event. As given in the MSDN example I have typecasted my (DataGridItemEventArg.Item.DataItem) to 'DataRowView). However during execution it gives me a error that this type-cast is not allowed.


    Does anybody know a way out?


    Thanks in advance,
    Sumedh

  • 18 years ago

    how about doing


    Debug.Write(DataGridItemEventArg.Item.DataItem.GetType().FullName);


    and then you should get the full datatype name of that item, so you know what variable type to use. (alternatively, just view it in the watch window - that will also display the correct type to you)


Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov