Re: Execute Javascript From Buttons Inside Datagrid

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon (Jon_at_discussions.microsoft.com)
Date: 07/30/04


Date: Fri, 30 Jul 2004 06:13:02 -0700

Yeah, thats what I was originally hoping for, BUT....
'attributes is not a member of System.Web.UI.WebControls.ButtonColumn'
so you cant do it that way. Unless theres a reference or property I might be missing??

-- 
Any info will be very appreciated!
Jon
"Shiva" wrote:
> Hi,
> You can use the Attributes collection of the dynamic button as in:
> 
> objbc.Attributes.Add("onClick", "window.open('http://www.google.com',
> 'googleWin');")
> 
> "Jon" <Jon@discussions.microsoft.com> wrote in message
> news:8505E2E2-C195-4D2D-96AF-53D5B531CFA6@microsoft.com...
> Hello,
> I have a datagrid and the data in it is dynamically created at runtime...
> 
> For iCounter = 0 To dataset.Tables(0).Columns.Count - 1
>                     Dim objbc As New BoundColumn()
> 
>                     With objbc
>                         .DataField =
> dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
>                         .HeaderText =
> dsAllPastReplies.Tables(0).Columns(iCounter).ColumnName
>                         If .DataField =
> dsAllPastReplies.Tables(0).Columns("ReplyID").ColumnName Then
>                             .Visible = False
>                         End If
>                     End With
> 
>                     With datagrid1
>                         .Columns.Add(objbc)
>                         .DataSource = dsAllPastReplies.Tables(0)
>                         .DataBind()
>                     End With
>                 Next
>                 dsAllPastReplies.Clear()
> 
> I can add a column of buttons at design time, but how can I fire off some
> javascript when a button is clicked?  I would ultimately like to have a user
> click one of the buttons and data in the corresponding row for a given
> column would come up in a popup window.  I have the javascript to do the
> popup, but I cant figure out how to call it from the dynamically created
> buttons.
> -- 
> Any info will be very appreciated!
> 
> Jon
> 
> 
> 


Relevant Pages

  • Re: Execute Javascript From Buttons Inside Datagrid
    ... > "Jon" wrote in message ... > so you cant do it that way. ... >> column would come up in a popup window. ... I have the javascript to do the ...
    (microsoft.public.dotnet.general)
  • Re: Execute Javascript From Buttons Inside Datagrid
    ... I have a datagrid and the data in it is dynamically created at runtime... ... column would come up in a popup window. ... I have the javascript to do the ... but I cant figure out how to call it from the dynamically created ...
    (microsoft.public.dotnet.general)
  • Re: Execute Javascript From Buttons Inside Datagrid
    ... void MyGrid_DataBound(Object sender, DataGridItemEventArgs e) ... > "Jon" wrote in message ... > column would come up in a popup window. ... I have the javascript to do the ...
    (microsoft.public.dotnet.general)
  • Re: Windows Form Dictionary
    ... intBookId (INT) ... I show this content in webBrowser  control. ... i cant use html file or tag or link style or other ... I obtain the word which double click with javascript, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help with IE6/Javascript
    ... >> Whenever I go to this page from my laptop or home computer I cant ... >> JavaScript in your browser to switch the measurements on this page ...
    (microsoft.public.windows.inetexplorer.ie6.browser)