LinkButton in GridView - asp.net

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.

Related

Insert Records From GridView to another GridView Page

Can somebody help me?
I am developing a website using Microsoft Expression Web. My database is MS Access. My page extension is .aspx (ASP.NET)
I have two gridview:
Pending Records GridView should be under a PendingRecords.aspx page. I want this gridview to allow me to accept first all the requested records before they go straight under the Main Gridview. Of course, the gridview have "ADD" button. When I click the button, I want the records to be transfer in Main Records GridView.
Main GridView should be under a Records.aspx page. I want this gridview to display all the records that I already accepted in Pending Records Gridview.
Simple as that!
Thanks in advance!
one the button click event save the data from first gridview into the session and when load it again in the second gridview when page loads or reloads.
it will work if you don't have much data to move.....
hope will give you some idea.... :)

How to fill a TextBox in InsertItemTemplate(ListView) with a selected Value from ModalPopup displayed by clicking a Link in the InsertItemTemplate?

I have really put in significant efforts to somehow find an answer; having failed I have then searched many forums before coming to bother the experts here. Please help!
I have a Listview in a USerControl of my main form; its InsertItemTemplate has a TextBox whose value is to be filled in by Clicking a Linkbutton in a Row of another Listview (in another UserControl) in the ModalPopUp Panel, which Pops up when a Linkbutton in the Parent UserControl is Clicked. After the selection (by clicking the LinkButton in the ModalPopUp), the ModalPopup closes immediately and in Code-Behind of the Child-UserControl, I save the Selected-Value in a Session variable. My problem is (Because the InsertItemTemplate is already remaining displayed) I do not know where to put the code for filling the TextBox (in the Parent UserControl) with the saved value from the Session-Variable.
ItemCreated, ItemDataBound are already executed before the ModalPopUp is displayed. So, though I have the required Value of the TextBox in the Session-Variable, I am unable to fill the TextBox in the InsertItemTemplate.
I will appreciate any suggestions, if any of you have found any answers to such a situation. I feel SOMEHOW the InsertItemTemplate should be made to load again and this TextBox in it should be filled in the ItemCreated for the InserItem datatype. But I do not know how to make it happen???
Any thoughts welcome. I have similar logic in many places in my App; and if I can't do it it will significantly affect my app :-(.
Hope one of you experts will kindly help me out. Thanks.
Thanks. I could fix it. Mentioning it here for some newbie (like me) who may face a similar issue.
The question was, where to put the Code (for the Selected Value to fill the TextBox in the InsertItemTemplate) in the scenario described above in the question.
I find that in the Pre-Render Event of the Parent UserControl, in the PostBack mode, after finding the said TextBox Control via the e.InsertItem.FindControl("TextBox"), I am able to fill it with the selected value. I don't know if this is the best way to do it, but it works fine now.
Hope this may be of some help to someone! Thanks.

UpdatePanel not updating with large amounts of data

I have an UpdatePanel which contains GridView and submit button, selecting the submit button causes the update panel to update OK when the GridView contains not many records, however, when the grid view contians a large amount of data, clicking the submit button does not cause the UpdatePanel to update.
Any ideas, I do not know if there is a restriction on the amount of data that can be sent using the ScriptManage/UpdatePanel, but in one instance the page size is 718Kb.
I'm not aware of any restrictions in size but maybe the page is just timing out somewhere? The best idea if you can is to limit the amount of data that you are passing back and forth.
ek_ny's suggestion Re: EnableViewState is a good one that will slash your page sizes if you can implement it.
Another idea is to implement paging in your Gridview so that you are only displaying a manageable number of rows at a time.
If you rebind the GridView then you don't need the GridView to be in the ViewState and you can set the EnableViewState of the GridView property to false.

callback in one aspxgridview causes all gridviews to databind

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

ASP.NET GridView - Editing Dynamic Template Columns

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/

Resources