Hello all,
I have an ultrawebgrid that has many rows and many columns. On the Task column, I have embedded an asp.net 2.0 LinkButton and in there I have the link to open up a .aspx modal. The modal does opens up on the second click on the Link Button. After the first click it seems to initialize the link opens up the modal and after that when I tried to opens up the modal again on that same row, it will open up on the first click. And if I were to go onto the second row and click the link for the first time, it would not open up the modal, but on the second click, third click , and so on (on that second row), then it will open up the modal.
So my question is, how do I initialize the link to the modal on either Page_Load, InitializeLayout or InitializeRow event methods. I have tried it on all three but none of them work because it cannot find the instance of my asp.net LinkButton.
It seems like, it will only initialize the modal link when it invoke the LinkButton1_Click event.
LinkButton1_Click (object sender, EventArgs e)
{
//Create an instance of the LinkButton
LinkButton lnkButton = (LinkButton) sender;
//some javascript function
script = "javascript code here";
Page.ClientScript.RegisterStartupScript(typeof(Page), "modalDlg", script);
lnkButton.Attributes.Add("onClick", "doIt();"); // doIt(); is the javascript function from the "script" block two lines above
}
I have tried using FindControls ("LinkButton1") but it cannot find it in neither Page_Load, InitializeLayout or InitializeRow.
If someone knows how to solve this, please shred some light on me.
Thanks very much in advance!
Hs2
Sofia,
Thanks for your help.
InitializeDataSource Event not match for my requirement. any other aways possible to implement?
Hello,
I am also trying to pick up the pieces and get the whole picture right, but it is a bit difficult for me to get everything right away. For DataBinding, I would suggest a couple of things
1) If possible, always use the InitializeDataSource event of the grid to bind the grid with data - this event is automatically called when the grid needs data
2) Take a look at the following blog post - it provides internal insights how data is bound to the grid and how to use it
http://blogs.infragistics.com/blogs/tony_lombardo/archive/2008/01/29/demystifying-infragistics-webgrid-databinding.aspx
Helloo,
Please help me below issues
This is the first time I am using Infragistics controls, I have searched this forum and the net but have not found a solution to my problem.
I have a search form on my .Net page, on pressing a submit I bind the UltraWebGrid(from code behind) and make the asp Panel contianing the UWG visible. One of the Columns of the UWG is a templated column containing an ASP linkbutton. OnClick of the link button is wired on the page. There is no paging on the grid.
So far so good. I get an error when I press the Link button; object reference not set...... The error points to one of the controls on the templated columns. It seems some sort of rebinding is required...something to do with viewstate.
Can some help me in figuring out what could be wrong, perhaps pointing to some code sample that does what I have described above.
Thanks for help. I have found the solution and resolved the issues.
Code:
<igtbl:TemplatedColumn>
<CellTemplate>
<asp:LinkButton ID="linkBtn" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"SampleDataCount")%>' CommandName="SampleDataCount" ForeColor="#3F0400" ><%#DataBinder.Eval(Container.DataItem,"SampleDataCount")%></asp:LinkButton>
</CellTemplate>
</igtbl:TemplatedColumn>
</Columns>
Regards
Sudhakar Rao - MCSD.Net,MCTS
Please help me this question also:
How to bind Link button dynamic? using the UltraWebGrid_InitializeLayout.