Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Adding Double Click Even to Datagrd


Message #1 by Carlos Magalhaes <CarlosM@t...> on Wed, 15 Jan 2003 14:54:31 +0200
Hi all,

 

I read an article (written by Das) on
http://aspalliance.com/das/datagriddblclick.aspx
<http://aspalliance.com/das/datagriddblclick.aspx>  that adds double click
functionality to the rows in your data grid. But what I am trying to do it
when the user double clicks on any row, the row that was double clicked will
go into edit mode just like as if the user clicked on the edit button.

 

Has anyone implemented this, currently I have in my DataGrid1_ItemDataBound
sub ,

 

Dim itemType As ListItemType = e.Item.ItemType

 

        If ((itemType = ListItemType.Pager) Or (itemType 
ListItemType.Header) Or (itemType = ListItemType.Footer)) Then

            Return

        Else

            e.Item.Attributes.Add("OnDblClick",
"DataGrid1.EditCommandName;")

 

        End If

 

But its not doing much (actually its not doing anything) , can one not call
the edit command while you adding an attribute? What is the best way of
doing this?

 

Regards,

Carlos Magalhaes

 


Message #2 by "Rohit Arora" <rohit_arora@i...> on Wed, 15 Jan 2003 18:56:48 +0530
The best way could be to use Itemtemplate for each column of datagrid and
provide user with a update reset buttons with
functonality for update and resetting the values

regards
rohit



-----Original Message-----
From: Carlos Magalhaes [mailto:CarlosM@t...]
Sent: Wednesday, January 15, 2003 6:25 PM
To: ASP.NET
Subject: [aspx] Adding Double Click Even to Datagrd


Hi all,



I read an article (written by Das) on
http://aspalliance.com/das/datagriddblclick.aspx
<http://aspalliance.com/das/datagriddblclick.aspx>  that adds double click
functionality to the rows in your data grid. But what I am trying to do it
when the user double clicks on any row, the row that was double clicked will
go into edit mode just like as if the user clicked on the edit button.



Has anyone implemented this, currently I have in my DataGrid1_ItemDataBound
sub ,



Dim itemType As ListItemType = e.Item.ItemType



        If ((itemType = ListItemType.Pager) Or (itemType 
ListItemType.Header) Or (itemType = ListItemType.Footer)) Then

            Return

        Else

            e.Item.Attributes.Add("OnDblClick",
"DataGrid1.EditCommandName;")



        End If



But its not doing much (actually its not doing anything) , can one not call
the edit command while you adding an attribute? What is the best way of
doing this?



Regards,

Carlos Magalhaes






Message #3 by Carlos Magalhaes <CarlosM@t...> on Wed, 15 Jan 2003 15:32:15 +0200
Hmmmm, 

 

But then I could use the current Edit,Update,Cancel col provided by the DG
no?

 

What I am trying to do is replace the Edit button with a Double click kinda
like the Windows forms control....

 

Regards,

Carlos Magalhaes

 

 

-----Original Message-----
From: Rohit Arora [mailto:rohit_arora@i...] 
Sent: Wednesday, January 15, 2003 3:27 PM
To: ASP.NET
Subject: [aspx] RE: Adding Double Click Even to Datagrd

 

The best way could be to use Itemtemplate for each column of datagrid and

provide user with a update reset buttons with

functonality for update and resetting the values

 

regards

rohit

 

 

 

-----Original Message-----

From: Carlos Magalhaes [mailto:CarlosM@t...]

Sent: Wednesday, January 15, 2003 6:25 PM

To: ASP.NET

Subject: [aspx] Adding Double Click Even to Datagrd

 

 

Hi all,

 

 

 

I read an article (written by Das) on

http://aspalliance.com/das/datagriddblclick.aspx

<http://aspalliance.com/das/datagriddblclick.aspx>  that adds double click

functionality to the rows in your data grid. But what I am trying to do it

when the user double clicks on any row, the row that was double clicked will

go into edit mode just like as if the user clicked on the edit button.

 

 

 

Has anyone implemented this, currently I have in my DataGrid1_ItemDataBound

sub ,

 

 

 

Dim itemType As ListItemType = e.Item.ItemType

 

 

 

        If ((itemType = ListItemType.Pager) Or (itemType 

ListItemType.Header) Or (itemType = ListItemType.Footer)) Then

 

            Return

 

        Else

 

            e.Item.Attributes.Add("OnDblClick",

"DataGrid1.EditCommandName;")

 

 

 

        End If

 

 

 

But its not doing much (actually its not doing anything) , can one not call

the edit command while you adding an attribute? What is the best way of

doing this?

 

 

 

Regards,

 

Carlos Magalhaes

 

 

 

 

 




 

 





Message #4 by "Rohit Arora" <rohit_arora@i...> on Wed, 15 Jan 2003 19:19:14 +0530
I had already put a lot of time on what you want to do..n wht i got the best
is what i suggested to you. Things cannot alwayz be like the way we want.

In this you can traverse each datarow.

Can check if current value is diffrent from original value or something like
this.

datarow currRow

a = currRow["columnname", datarowversion.current/original/proposed/default]

etc

to reset
foreach currRow in datagrid
currRow["columnname"]= currRow["columnname", datarowversion.original]


maybe this helps.This could be a way but not the only way. If you find that
double clicky thing pl let me know.

thanx and regards
rohit

-----Original Message-----
From: Carlos Magalhaes [mailto:CarlosM@t...]
Sent: Wednesday, January 15, 2003 7:02 PM
To: ASP.NET
Subject: [aspx] RE: Adding Double Click Even to Datagrd


Hmmmm,



But then I could use the current Edit,Update,Cancel col provided by the DG
no?



What I am trying to do is replace the Edit button with a Double click kinda
like the Windows forms control....



Regards,

Carlos Magalhaes





-----Original Message-----
From: Rohit Arora [mailto:rohit_arora@i...]
Sent: Wednesday, January 15, 2003 3:27 PM
To: ASP.NET
Subject: [aspx] RE: Adding Double Click Even to Datagrd



The best way could be to use Itemtemplate for each column of datagrid and

provide user with a update reset buttons with

functonality for update and resetting the values



regards

rohit







-----Original Message-----

From: Carlos Magalhaes [mailto:CarlosM@t...]

Sent: Wednesday, January 15, 2003 6:25 PM

To: ASP.NET

Subject: [aspx] Adding Double Click Even to Datagrd





Hi all,







I read an article (written by Das) on

http://aspalliance.com/das/datagriddblclick.aspx

<http://aspalliance.com/das/datagriddblclick.aspx>  that adds double click

functionality to the rows in your data grid. But what I am trying to do it

when the user double clicks on any row, the row that was double clicked will

go into edit mode just like as if the user clicked on the edit button.







Has anyone implemented this, currently I have in my DataGrid1_ItemDataBound

sub ,







Dim itemType As ListItemType = e.Item.ItemType







        If ((itemType = ListItemType.Pager) Or (itemType 

ListItemType.Header) Or (itemType = ListItemType.Footer)) Then



            Return



        Else



            e.Item.Attributes.Add("OnDblClick",

"DataGrid1.EditCommandName;")







        End If







But its not doing much (actually its not doing anything) , can one not call

the edit command while you adding an attribute? What is the best way of

doing this?







Regards,



Carlos Magalhaes

























  Return to Index