I have a aspxgridview with details row.
in detils row of this gridview, there are about 10 aspxgridviews. whenever one of this grids cause callback by clicking edit/new/delete , other gridview also databound i.e hit database. this cause performance issue.
Is there a way to disable databinding on other aspxgridview?
tanks.
You can use tab content lazy loading. Look here for example and here for further explanation.
i find a solution here:
ASPxPageControl - Page Load of all TabPages
Related
I have a web page with a datagrid and a user control.
The user control has an event which the web page subscribes to.
On the user control event I need to rebind the datagrid on the web page.
I'm coming up with all sorts of problems due to extender controls that are attached to the grid indicating that they cannot be registered after prerender so it looks like the user control event occurs to late in the page life cycle. Either way those kinda errors would indicate that I'm on the wrong track completely.
I do not want a reference to my page in the user control if at all possible.
What is the best way to achieve this.
I had tried Binding the grid on PageLoad every time but found that although the Databind happened and the updated data was in the datasource that the grid contents did not reflect this. [Is it the GridView viewstate thats playing with this?]
Ding a full refresh or using a button to the page to rebind the grid allowed me to display the correct value.
Thanks in advance,
Liam
"I had tried Binding the grid on PageLoad every time but found that
although the Databind happened and the updated data was in the
datasource that the grid contents did not reflect this. [Is it the
GridView viewstate thats playing with this?]".
I think that the answer (in part at least) to this is that the third party control is using callbacks to get back to the server and not postbacks so this may be the issue. As I understand it the grid was binded OK but not rendered. [I hadn't come across the differences between Callbacks and Postbacks until this week!!]
I'm open to correction on this though. :)
Liam
I have a problem and not getting why is it so. I have a grid view and it contains some 10,000 rows without any pagination. For each Row I have a Edit LinkButton n the TemplateField. On the click of this edit LB the control should go to some Edit Page. The problem here is that after clicking on the LB the page is taking lots of time. On the other hand if I am doing pagination in the GridView and assgning page size = 10 then it is loading very fast. Can anyone please tell me what is the reason. I cant have the pagination for this gridView
Regards,
Vikram
GridView consumes a lot of ViewState.
if you are using other page for editing, maybe you should use Repeater instead of Gridview, and instead of the LinkButton just an Hyperlink with url EditPage.aspx?id={something}
Have you tried removing the viewstate of the grid?? I think that should sort out the issue.
Ok, i have a gridview and on page load, i dynamically add a column to it that contains a link control. this link control has a onclick event associated with it so that when its clicked, i want to do some processing. Now I have noticed that if I just bind the grid the first time (i.e. if(!IsPostBack) and have enableviewstate for the grid to be true, clicking the link in that column, doesnt trigger the onclick event. But if I bind the grid on every postback, everything seems to be working..does anyone know the reasoning behind it?
It happens because you're dynamically adding the column, so on every postback the column has to be created. What you may want to do is to look at Creating a Custom Column.
May be creating the row Id solves your problem. Check out this link and the post marked as answer.
http://forums.asp.net/p/1471128/3408069.aspx#3408069
Regards
Vinay
I have created a GridView whose columns are dynamically created based on my data source. I have implemented these columns by using the approach described here.Those columns display properly on the initial load. However, I need to implement commanding so that a user can edit / delete a row in the GridView.
At this point, I have implemented commanding as I would with a normal GridView. I have a TemplateField with an ItemTemplate that has LinkButton elements for edit and delete. The CommandName for each LinkButton is set to either Edit or Delete respectively.
Oddly, when a user clicks either the Edit or Delete link, the data in the GridView disappears. However, I have verified that I am in fact re-binding the data when one of these LinkButton elements is selected.
Can anyone provide some suggestions as to what the cause could be?
Thank you!
Here are good examples. You can figure out postback issue.
http://quickstarts.asp.net/QuickStartV20/aspnet/
On a page_load() ,
Is there a way of capturing that a paging value has been changed? (e.g.from page 1 to page 2)
This relates to a Gridview control
John - why are you looking for this in the page_load? You may be better off handling the PageIndexChanged or PageIndexChanging events on the gridview instead.
In the event that you need to know the control that caused the postback during the page_load - look at this post for a solution. In that solution, they suggest that you query the Request["__EVENTTARGET"] variable. Another similar solution is here.