Last post Jan 17, 2011 12:54 PM by Shuvo Aymon
Jan 14, 2011 10:43 AM|Apocolyptica|LINK
I have a gridview with results from a database query and columns where I add linkbuttons to individual cells.
Dim LB2 As New LinkButton
LB2.Text = "title"
LB2.CommandArgument = "argument"
AddHandler LB2.Click, AddressOf LaunchDocument
There is a lot time involved in determining what cells get the linkbutton and I want to avoid going through that process on a postback when a user clicks one of the linkbuttons.
How can I maintain these controls in the gridview after a user clicks a linkbutton and a postback is done? Right now the application has to go through the process all over again.
Thanks for any help....
Jan 14, 2011 11:37 AM|Shuvo Aymon|LINK
DataTextField="ID" Text="Manage Childs" />
Jan 14, 2011 12:40 PM|Apocolyptica|LINK
Thank you for your time but unfortunately that wont work in this situation.
Basically the links are to various pdf files but the application has to be able to identify the right file based on data in
the other columns of the data grid. The file names are not in a friendly format so some string manipulation has to be done
so that the right file is being selected. There is more to it than that but it's one of the reasons I am adding the controls this way.
Jan 14, 2011 12:54 PM|Shuvo Aymon|LINK
you can use a TemplateField and set it's
in code behind you may define
public string ()
the function will do all the string calculation and will return the result to gridview column.
you may use this. but don't worry i will answer bit later in the way you want it.
is it possible to send me your aspx page?
Jan 17, 2011 11:30 AM|linux|LINK
What did you do so far?
Can you post complete code?
Jan 17, 2011 11:56 AM|Apocolyptica|LINK
Thanks all, I got it work by storing the document information for each row in a collection with a unique key and setting a session variable equal to the collection. Then on postback I just reload it from the session variable instead of running through the
whole process again.
Jan 17, 2011 12:54 PM|Shuvo Aymon|LINK