Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DataGrid with a menu...

Reply
Thread Tools

DataGrid with a menu...

 
 
Pai
Guest
Posts: n/a
 
      04-30-2004
Hello there,

I need to create a Data Grid for an ASP.Net Page which would have all
these feature.

When the user sets focus on one of the colums the column of the Data
Grid it should display a list of menu options to the
right hand side of the column which would have various options for
the menu, but the menu should be smaller then the width of the

Is it possible to trace which column the user has selected? I am also
unable to set the AutoPostBask event for the DataGrid?

Hope somebody has some pointer on this?

Thanks,
Srikanth pai.
 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      05-01-2004
Your way forward here is to use the itemcreated or itemdatabound event
handler to embed javascript in the cells using the onmouseover events. You
can add this using attributes. It follows the same pattern as row
highlighting in a datagrid with a mouse over event.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Pai" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hello there,
>
> I need to create a Data Grid for an ASP.Net Page which would have all
> these feature.
>
> When the user sets focus on one of the colums the column of the Data
> Grid it should display a list of menu options to the
> right hand side of the column which would have various options for
> the menu, but the menu should be smaller then the width of the
>
> Is it possible to trace which column the user has selected? I am also
> unable to set the AutoPostBask event for the DataGrid?
>
> Hope somebody has some pointer on this?
>
> Thanks,
> Srikanth pai.



 
Reply With Quote
 
 
 
 
Srikanth Pai
Guest
Posts: n/a
 
      05-01-2004
Hello Alvin,

Thanks for you reply, is it possible for you to kindly guide me to some
site which has embeds javascript in the cells using the mouseover.

I am still unable to understand how the code would understand which
column has been selected in the datagrid, when i placed the datagrid on
the .aspx page i couldnot understand or find any method which would help
me be able to distinguish the columns or rows in the datagrid.

Also I would like to have a "+" sign which would group a set of rows in
the datagrid and "-" which would collapse all the rows and show is it
possible to implement this functionality using data grid or would i have
to use any other control?

I would appreciate if you would guide me in this

Thanks,
Srikanth Pai.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      05-02-2004
for the plus/- signs, you will need to add a column and set the text to

for the itemdatabound you can use something like this
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseover",
"this.style.backgroundColor='lightblue'");


this would put the mouse over for the entire row. if you want fine grain,
you can put the mouseover on a particular cell, which corresponds to a
column in the datagrid. Consider a mouseover event that calls a function
only on column 4

e.Item[5].Attributes.Add("onmouseover", "callMyJavascriptFunction()'");

when the user mouses over cell 4, the event fires and calls
callmyjavascriptfunction. You would be responsible for defining that
function clientside

for the +/- signs, you can add a column to the datagrid and set the text to
a "+" or "-". For both plus and minus, you will need to change the character
set to something like latin-1 - there is a plus/minus symbol in there you
can use as text. The button click would fire the itemcommand event so you
would handle this event to figure out what to do with the code.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Srikanth Pai" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hello Alvin,
>
> Thanks for you reply, is it possible for you to kindly guide me to some
> site which has embeds javascript in the cells using the mouseover.
>
> I am still unable to understand how the code would understand which
> column has been selected in the datagrid, when i placed the datagrid on
> the .aspx page i couldnot understand or find any method which would help
> me be able to distinguish the columns or rows in the datagrid.
>
> Also I would like to have a "+" sign which would group a set of rows in
> the datagrid and "-" which would collapse all the rows and show is it
> possible to implement this functionality using data grid or would i have
> to use any other control?
>
> I would appreciate if you would guide me in this
>
> Thanks,
> Srikanth Pai.
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Datagrid: how cut short display of a long description in a datagrid column Brian K. Williams ASP .Net 0 03-02-2004 08:35 PM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
datagrid in datagrid BK Kim ASP .Net 1 03-02-2004 06:34 AM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments