This is a migrated thread and some comments may be shown as answers.

Why Itemdatabound firing twice in radgrid using vb.net

2 Answers 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Loki
Top achievements
Rank 1
Loki asked on 18 Mar 2016, 11:52 AM

Hi telerik,

Strucked in getting resoluation, itemdatabound in radgrid firing twice in vb.net.

Thanks,

Lokesh

2 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 22 Mar 2016, 07:26 AM
Hello Lokesh,

Note that the ItemDataBound is fired for every item in RadGrid. This means that the event is raised for every DataItem and also for the corresponding EditFormItem. If you would like to implement code that will be executed only for the DataItems in the grid you can use the following approach:


Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs)
    If TypeOf e.Item Is GridDataItem Then
        ' add custom logic here
    End If
End Sub


Check out the following article that elaborates on the matter in more detail:



Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Loki
Top achievements
Rank 1
answered on 22 Mar 2016, 09:36 AM

Hi Viktor Tachev,

it worked for me. Thank you so much.

 

Thanks,

Lokesh

Tags
Grid
Asked by
Loki
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Loki
Top achievements
Rank 1
Share this question
or