Click here to Skip to main content
15,898,373 members
Home / Discussions / C#
   

C#

 
AnswerRe: howto: pass parameters to a webservice from browser address bar Pin
chris_do25-Oct-06 0:11
chris_do25-Oct-06 0:11 
QuestionSerialization of a large dataset Pin
TeamWild24-Oct-06 22:40
TeamWild24-Oct-06 22:40 
AnswerRe: Serialization of a large dataset Pin
V.25-Oct-06 0:11
professionalV.25-Oct-06 0:11 
QuestionRandom numbers Pin
Jad Jadallah24-Oct-06 22:20
Jad Jadallah24-Oct-06 22:20 
AnswerRe: Random numbers Pin
quiteSmart24-Oct-06 22:40
quiteSmart24-Oct-06 22:40 
AnswerRe: Random numbers Pin
J4amieC24-Oct-06 22:41
J4amieC24-Oct-06 22:41 
AnswerRe: Random numbers Pin
V.25-Oct-06 0:08
professionalV.25-Oct-06 0:08 
QuestionHelp me to implement the GridView RowCommand method. Pin
chandu4codeproj24-Oct-06 22:15
chandu4codeproj24-Oct-06 22:15 
Hi,

I placed Gridview in my form and created boundfileds and template field. I placed Imagebuttons, hyperlinks in templatefield. I set the DataKeyNames property. After the grid is populated with some data, i want to show some tooltips when cursor is placed on the respective imagebutton and want to perform some task(like moving to next page based on the selectedrow datakeyname).

I was able to show the tooltip on mousehover. The code i worte is
protected void Gridview1_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
     if (e.Row.RowType == DataControlRowType.DataRow)<br />
     {			<br />
	ImageButton c1 = (ImageButton)e.Row.Cells[0].FindControl ("ctnBtn");<br />
	if(c1 != null) <br />
        {<br />
             	c1.Attributes.Add("onmouseover", "");<br />
		c1.Attributes.Add("onmouseout", "");<br />
        }<br />
     }<br />
}


But not able to get the datakeyname of that particlar selected row.

protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e)<br />
{<br />
      if (e.CommandName == "ctn")<br />
      {<br />
          string key = Gridview1.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString();<br />
          string url = "qwer.aspx?key="+key.ToString();          <br />
          Response.Redirect(url);<br />
          ....<br />
      }<br />
}

I was able to get the e.commandname correctly and gettig into the loop but was not getting the
e.CommandArgument of the selected row. It is showing the null everytime.

I was able to implement this rowcommand function correctly when the imagebutton control is not in the template field.

Let me know how to implement the Findcontrol method for <asp:buttonfield> of GridView

Let me know where i went wrong in implementing the code.

Thanks in Advance.
QuestionUtf-8 xml string or removing encoding="..." Pin
Csupor Jenő24-Oct-06 22:08
Csupor Jenő24-Oct-06 22:08 
AnswerRe: Utf-8 xml string or removing encoding="..." Pin
Csupor Jenő24-Oct-06 22:38
Csupor Jenő24-Oct-06 22:38 
Questioncount specific character in string Pin
Vipin.d24-Oct-06 21:05
Vipin.d24-Oct-06 21:05 
AnswerRe: count specific character in string Pin
quiteSmart24-Oct-06 21:22
quiteSmart24-Oct-06 21:22 
AnswerRe: count specific character in string Pin
Stefan Troschuetz24-Oct-06 21:24
Stefan Troschuetz24-Oct-06 21:24 
AnswerRe: count specific character in string Pin
Nicholas Butler24-Oct-06 22:32
sitebuilderNicholas Butler24-Oct-06 22:32 
AnswerRe: count specific character in string Pin
Guffa24-Oct-06 22:58
Guffa24-Oct-06 22:58 
Questionhow to use the printDialogBox? Pin
quiteSmart24-Oct-06 20:11
quiteSmart24-Oct-06 20:11 
AnswerRe: how to use the printDialogBox? Pin
Nader Elshehabi24-Oct-06 22:03
Nader Elshehabi24-Oct-06 22:03 
GeneralRe: how to use the printDialogBox? Pin
quiteSmart24-Oct-06 22:43
quiteSmart24-Oct-06 22:43 
QuestionHow can I add the assembly Microsoft.Office.Interop.Outlook? Pin
OctopusThu24-Oct-06 19:26
OctopusThu24-Oct-06 19:26 
AnswerRe: How can I add the assembly Microsoft.Office.Interop.Outlook? Pin
OctopusThu24-Oct-06 19:36
OctopusThu24-Oct-06 19:36 
QuestionCustom Draw TreeView problem - Painted "+" got overriden Pin
DiegoValdevino24-Oct-06 19:18
DiegoValdevino24-Oct-06 19:18 
QuestionCustom UserControl shape problem... Pin
Kasic Slobodan24-Oct-06 16:08
Kasic Slobodan24-Oct-06 16:08 
AnswerRe: Custom UserControl shape problem... Pin
Kasic Slobodan27-Oct-06 7:31
Kasic Slobodan27-Oct-06 7:31 
QuestionApplication.Exit(); not working in the form constructor, why? Pin
AngryC24-Oct-06 14:57
AngryC24-Oct-06 14:57 
AnswerRe: Application.Exit(); not working in the form constructor, why? Pin
Nader Elshehabi24-Oct-06 15:22
Nader Elshehabi24-Oct-06 15:22 

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.