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

RadGrid Item Databound for ReadOnly grid

3 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Govindaraj Kathirvel
Top achievements
Rank 1
Govindaraj Kathirvel asked on 02 Dec 2013, 10:35 PM

We are using RadGrid for ready only purpose and the item Databound event fires twice for GridDataItem & GridEditableItem.

Even though its read only it fires twice. Are there any settings we can restrict the unwanted events.
 

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Dec 2013, 06:04 AM
Hi Govindaraj Kathirvel,

The doubled event firing might happen due to explicit Rebind() call somewhere in your code (which will force rebind action for the grid) or if you attached the ItemDataBound event twice. Make sure you haven't called DataBind() or Rebind() anywhere so as to raise the ItemDataBound. In order to further troubleshoot, please provide your code snippet.

Thanks,
Princy

0
Govindaraj Kathirvel
Top achievements
Rank 1
answered on 03 Dec 2013, 02:40 PM
 
I guess my post wasn't clear.  We are using DataBind() (Not using OnNeedDataSource) and when we bind 10 rows the itemdatabound is firing around 24 times. we are not using any editable feature but still is firing for GridEditableItem. Is there a way we can avoid/control the unwanted events firing in read only mode.

10 times for GridDataItem
10 times for GridEditabelItem
1 - FooterItem
1-HeaderItem
1- PaginationItem
 
0
Princy
Top achievements
Rank 2
answered on 04 Dec 2013, 09:02 AM
Hi Govindaraj Kathirvel,

Simple data-binding can be used in simple cases when you do not require the grid to perform complex operations such as Inserting, deleting, and updating records through custom edit forms (WebUserControl or FormTemplate), Grouping, Hierarchy relations, Filtering, Sorting, Paging etc.

For advanced features such as those listed above, RadGrid must be bound using declarative data sources or through the NeedDataSource event. When using declarative data sources or the NeedDataSource event, RadGrid can automatically accommodate the appropriate database operations without the need for you explicitly handle any sorting, paging, grouping, and so on.
So I suggest you use declarative data sources or the NeedDataSource event.If this doesn't help, please provide your full code snippet.

Thanks,
Princy

Tags
Grid
Asked by
Govindaraj Kathirvel
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Govindaraj Kathirvel
Top achievements
Rank 1
Share this question
or