Click here to Skip to main content
15,900,110 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Datagrid question?? Pin
_AK_23-Apr-07 0:23
_AK_23-Apr-07 0:23 
GeneralRe: Datagrid question?? Pin
Nada Adel23-Apr-07 1:04
Nada Adel23-Apr-07 1:04 
GeneralRe: Datagrid question?? Pin
_AK_23-Apr-07 1:38
_AK_23-Apr-07 1:38 
GeneralRe: Datagrid question?? Pin
Nada Adel23-Apr-07 3:15
Nada Adel23-Apr-07 3:15 
GeneralRe: Datagrid question?? Pin
_AK_23-Apr-07 5:10
_AK_23-Apr-07 5:10 
GeneralRe: Datagrid question?? Pin
Nada Adel23-Apr-07 9:41
Nada Adel23-Apr-07 9:41 
GeneralRe: Datagrid question?? Pin
_AK_23-Apr-07 19:08
_AK_23-Apr-07 19:08 
GeneralRe: Datagrid question?? Pin
Nada Adel23-Apr-07 21:56
Nada Adel23-Apr-07 21:56 
thnx for the quick replySmile | :)
I've mentioned the Item_Command event of the datagrid:

public void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.DataBind();
Response.Write("Nada"); //does not appear
if (e.CommandName == "lnkShow2")
{
//Some code
}
}
when I press the linkbutton in the template column, the item_command event. He never enters it in the first place. It is never executed.

Did I miss the definition of the Item_Command event, I mean it was working when I designed the Template Column at design time. Is there something missing. Here's my code:

TemplateColumn tColStatus = new TemplateColumn();
tColStatus.HeaderText = "Status";
DataGrid1.Columns.Add(tColStatus);

// Creating the Control
protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
LinkButton LinkButton2 = new LinkButton();
LinkButton2.EnableViewState = true;
LinkButton2.ID = "lnkShow";
LinkButton2.Text = "Show";
LinkButton2.CommandName = "lnkShow2";

e.Item.Cells[1].Controls.Add(LinkButton2);
}


}

Please check it and let me know if I missed something. I really want it work. I appreciate all ur help
GeneralRe: Datagrid question?? Pin
_AK_23-Apr-07 22:12
_AK_23-Apr-07 22:12 
GeneralRe: Datagrid question?? Pin
Nada Adel23-Apr-07 22:18
Nada Adel23-Apr-07 22:18 
GeneralRe: Datagrid question?? Pin
_AK_23-Apr-07 22:23
_AK_23-Apr-07 22:23 
GeneralRe: Datagrid question?? Pin
Nada Adel23-Apr-07 22:29
Nada Adel23-Apr-07 22:29 
GeneralRe: Datagrid question?? Pin
_AK_23-Apr-07 23:46
_AK_23-Apr-07 23:46 
GeneralRe: Datagrid question?? Pin
Nada Adel24-Apr-07 0:58
Nada Adel24-Apr-07 0:58 
GeneralRe: Datagrid question?? Pin
_AK_24-Apr-07 1:22
_AK_24-Apr-07 1:22 
QuestionTime comparison Pin
Exelioindia22-Apr-07 23:21
Exelioindia22-Apr-07 23:21 
AnswerRe: Time comparison Pin
Rakheesh Chalil23-Apr-07 11:47
Rakheesh Chalil23-Apr-07 11:47 
QuestionAsp:contentplaceholder in head? Pin
Russell Jones22-Apr-07 22:41
Russell Jones22-Apr-07 22:41 
AnswerRe: Asp:contentplaceholder in head? Pin
Russell Jones22-Apr-07 23:15
Russell Jones22-Apr-07 23:15 
GeneralRe: Asp:contentplaceholder in head? Pin
RichardGrimmer23-Apr-07 5:40
RichardGrimmer23-Apr-07 5:40 
Questionpopup window Pin
sangramkp22-Apr-07 22:26
sangramkp22-Apr-07 22:26 
AnswerRe: popup window Pin
_mubashir22-Apr-07 22:33
_mubashir22-Apr-07 22:33 
QuestionERROR : Cannot open database "Ranking" requested by the login. The login failed. Login failed for user 'Computer\ASPNET'. Pls Reply urgent Pin
Faisal Khatri22-Apr-07 21:29
Faisal Khatri22-Apr-07 21:29 
AnswerRe: ERROR : Cannot open database "Ranking" requested by the login. The login failed. Login failed for user 'Computer\ASPNET'. Pls Reply urgent Pin
_mubashir22-Apr-07 22:08
_mubashir22-Apr-07 22:08 
QuestionIs there Any free project? Pin
Care Career22-Apr-07 21:23
Care Career22-Apr-07 21:23 

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.