Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a datagrid, I removed the "edit" button, and "edititemtemplate" because I wanted users to bypass "edit" and go directly to "update"/"cancel" buttons...

 

I added a LinkButton for "update" ...Everything is fine so far..

 

Now, when the user clicks "Update", I want to get the datagrid's values and update BUT ..

 

The linkButton does NOT have "e As DataGridCommandEventArg". It looks like this:

Private Sub lbUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbUpdate.Click 

 

So, I cant have, for example: dim sShort= CType(e.Item.FindControl("short_desc"), TextBox).Text

 

I tried this : Dim SShort = dgIncid.FindControl("txtDesc") but i dont get the value...

 

So, how can I get to the datagrid's columns if I'm using a LinkButton??

Posted

Set the commandname property of the linkbutton to Update and then set the OnUpdateCommand event of the datagird to

LB_Update(sender As Object, e As DatagridCommandEvent Args) or whatever.

 

Then you will be able to use e.Item.FindControl("cntrlName")

 

-lp

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...