Click here to Skip to main content
15,922,427 members
Home / Discussions / C#
   

C#

 
GeneralRead Outlook express - 6 contacts using c# 2005 Pin
Member 4463561 @##$#%$#%*(*&^(&)(_++[25-Feb-08 4:02
Member 4463561 @##$#%$#%*(*&^(&)(_++[25-Feb-08 4:02 
GeneralRe: Read Outlook express - 6 contacts using c# 2005 Pin
Judah Gabriel Himango25-Feb-08 5:54
sponsorJudah Gabriel Himango25-Feb-08 5:54 
GeneralRun time error Pin
Mc_Topaz25-Feb-08 3:57
Mc_Topaz25-Feb-08 3:57 
GeneralRe: Run time error Pin
Judah Gabriel Himango25-Feb-08 5:48
sponsorJudah Gabriel Himango25-Feb-08 5:48 
GeneralRe: Run time error [modified] Pin
Mc_Topaz25-Feb-08 20:23
Mc_Topaz25-Feb-08 20:23 
GeneralRe: Run time error Pin
Judah Gabriel Himango26-Feb-08 6:33
sponsorJudah Gabriel Himango26-Feb-08 6:33 
GeneralRe: Run time error Pin
Gareth H25-Feb-08 6:54
Gareth H25-Feb-08 6:54 
Question[Datagrid] How to disable row selection when Button from ButtonColumn is selected [modified] Pin
Soulhalo25-Feb-08 3:51
Soulhalo25-Feb-08 3:51 
Hi all,

Just now I ran into a problem concerning the datagrid and it's row selection.

Currently I'm using the datagrid to select a whole bunch of data from a database. When I click a row it opens a new window with

e.Item.Attributes.Add("onclick", "window.open('whateverpage.aspx?action=id="((DataRowView)e.Item.DataItem).Row["id"].ToString()')"

this (well not exactly that but thats not the point) is included in the datagrid's itemcreated handler.
The datagrid's datasource is a table from the database as to auto generate the columns ( must auto generate btw) and I add a buttoncolumn code-wise.

Now the problem is when I click the button it first handles the row selection, and as such it opens up the new window, which I want to avoid. After all this it finally handles the button, which works fine.

So how do I disable the onclick event ( the row event) for the button column, or I guess any way to avoid the new window popping up is appreciated.

I hope this is possible, if it is not, an acceptable work around would be to close the new window from the button handler ( from the old page)... but I haven't been able to figure out how to do that, since I don't know how to close the new window from the old one or how to pass a (session) variable to the new window before the page loads.

So to clarify , I have a datagrid with selectable rows and a button column. When one selects the button from the buttoncolumn it also selects the row and thus opens a new window before the button is handled.

Hopefully this is enough information to solve the problem, please let me know if I should post additional info to clarify the problem.

Thanks in advance!!

modified on Thursday, February 28, 2008 11:00 AM

QuestionPop3 Protocol Pin
Sunshine Always25-Feb-08 3:12
Sunshine Always25-Feb-08 3:12 
GeneralRe: Pop3 Protocol Pin
DaveyM6925-Feb-08 3:34
professionalDaveyM6925-Feb-08 3:34 
Generalround Pin
arkiboys25-Feb-08 2:09
arkiboys25-Feb-08 2:09 
GeneralRe: round Pin
DaveyM6925-Feb-08 2:14
professionalDaveyM6925-Feb-08 2:14 
GeneralRe: round Pin
Guffa25-Feb-08 2:34
Guffa25-Feb-08 2:34 
GeneralHelp regarding multiline textbox Pin
i_want_to_learn_c#25-Feb-08 2:00
i_want_to_learn_c#25-Feb-08 2:00 
GeneralRe: Help regarding multiline textbox [modified] Pin
DaveyM6925-Feb-08 2:10
professionalDaveyM6925-Feb-08 2:10 
GeneralRe: Help regarding multiline textbox Pin
Luc Pattyn25-Feb-08 4:55
sitebuilderLuc Pattyn25-Feb-08 4:55 
GeneralRe: Help regarding multiline textbox Pin
i_want_to_learn_c#26-Feb-08 0:37
i_want_to_learn_c#26-Feb-08 0:37 
GeneralRe: Help regarding multiline textbox Pin
Luc Pattyn26-Feb-08 1:01
sitebuilderLuc Pattyn26-Feb-08 1:01 
Generalright click on grid Pin
sobhaniir25-Feb-08 1:48
sobhaniir25-Feb-08 1:48 
GeneralRe: right click on grid Pin
J a a n s25-Feb-08 4:51
professionalJ a a n s25-Feb-08 4:51 
GeneralSending Invitation to other system which is in same LAN Pin
NarVish25-Feb-08 1:44
NarVish25-Feb-08 1:44 
GeneralString iterations .... Pin
nareshss25-Feb-08 0:37
nareshss25-Feb-08 0:37 
GeneralRe: String iterations .... Pin
Harvey Saayman25-Feb-08 0:41
Harvey Saayman25-Feb-08 0:41 
GeneralRe: String iterations .... Pin
Himanshu Joshi25-Feb-08 0:46
Himanshu Joshi25-Feb-08 0:46 
GeneralRe: String iterations .... Pin
Harvey Saayman25-Feb-08 0:47
Harvey Saayman25-Feb-08 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.