PDA

View Full Version : سوال: rowcommand کار نمی کنه



Arsham**
شنبه 25 دی 1389, 14:08 عصر
سلام
تو رو خدا به دادم برسین:افسرده:
نمی دونم این برنامه چشه؟؟!!
چند تا پنل ajax دارم که تو هر کدومش یک گریدویو هست همه گریدویو ها هم rowcommand دارن، خیر سرشون.:عصبانی++:
اما وقتی اجرا می کنم فقط Rowcommand اولی اجرا میشه و بقیه حتی به روی خودشون هم نمیارن.
پنلی که درست کار میکنه:

<asp:UpdatePanel runat="server" ID="TrackUpdatePanel">
<ContentTemplate>
<div>
<div>111111111111111:</div>
<div id="TrackGriddiv">
<asp:GridView id="TrackGrid" runat="server" OnRowCommand="TrackGrid_RowCommand" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<div style="width:40px;">
<div style="float:right">
<asp:ImageButton ID="BtnShowDetail" runat="server" CommandName="ShowDetail" CommandArgument='<%# Container.DataItemIndex+1 %>' ImageUrl="~/Images/button/remove.png"/>
</div>
<div style="float: right">
<asp:ImageButton ID="BtnShowClass" runat="server" CommandName="ShowClass" CommandArgument='<%# Container.DataItemIndex+1 %>' ImageUrl="~/Images/button/edit.png"/>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<SelectedRowStyle BackColor="#E0E0E0" Font-Bold="True" />
<RowStyle Font-Names="Tahoma" />
<HeaderStyle Font-Bold="False" Font-Names="Tahoma" />
</asp:GridView>
</div>
</div>

و :

protected void TrackGrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
int trackId;
switch (e.CommandName)
{
case "ShowDetail":
trackId = int.Parse(e.CommandArgument.ToString());
FillTrackDetailGrid(trackId);
break;
case "ShowClass":
trackId = int.Parse(e.CommandArgument.ToString());
FillClassGrid(trackId);
break;

}
}

پنلی که درست کار نمی کنه:


<asp:UpdatePanel runat="server" ID="FileUpdatePanel">
<ContentTemplate>
<asp:GridView id="FileGrid" runat="server" OnRowCommand="FileGrid_RowCommand">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<div style="width:40px;">
<div style="float:right">
<ajaxToolkit:ConfirmButtonExtender
ID="DelFileConfirm"
runat="server"
TargetControlID="BtnDelFile"
ConfirmText="آیا اطمینان دارید؟">
</ajaxToolkit:ConfirmButtonExtender>
<asp:ImageButton ID="BtnDelFile" CommandName="DeleteFile" CommandArgument='<%# Container.DataItemIndex+1 %>' runat="server" ImageUrl="~/Images/button/remove.png"/>
</div>
<div style="float: none">
<asp:ImageButton ID="BtnEditFile" runat="server" CommandArgument='<%# Container.DataItemIndex+1 %>' CommandName="EditFile" ImageUrl="~/Images/button/edit.png" />
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<SelectedRowStyle BackColor="#E0E0E0" Font-Bold="True" Font-Italic="False" Font-Names="Tahoma" />
<RowStyle Font-Names="Tahoma" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>

و :

protected void FileGrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
int rowId;
switch (e.CommandName)
{
case "DeleteFile":
rowId = int.Parse(e.CommandArgument.ToString());
DeleteFile(rowId - 1);
break;
case "EditFile":
rowId = int.Parse(e.CommandArgument.ToString());
EditFile(rowId - 1);
break;
}
}

چیکار کنم؟؟:گریه::عصبانی++:

Arsham**
یک شنبه 26 دی 1389, 09:19 صبح
یعنی هیچ کس نمی دونه؟