0
<bimsa:GridViewBase ID="gridYorum" runat="server"  KeyFieldName="Id" ClientInstanceName="gridYorumClient"  OnCustomButtonCallback="StatuGuncelleCallBack"
        KaynakKodu="0" Width="100%" OnCustomCallback="grid_CustomCallback"  >
        <ClientSideEvents  EndCallback="function(s, e) {
        }" />
        <Columns>
        <bimsa:DataColumn FieldName="Statu" Visible="false" ></bimsa:DataColumn>
            <bimsa:DataColumn FieldName="Yorum"  Width="430px"  Caption="<%$Resources: Controls, Yorum %>" VisibleIndex="1"></bimsa:DataColumn>
            <bimsa:DataColumn FieldName="OlusturanKullanici" Width="100px" Caption="<%$Resources: Controls, YorumSahibi %>" VisibleIndex="2" ></bimsa:DataColumn>
            <bimsa:DateTimeColumn FieldName="OlusturmaZamani" Width="100px" Caption="<%$Resources: Controls, YorumZamani %>" VisibleIndex="3" ></bimsa:DateTimeColumn >

            <bimsa:CommandColumn  KaynakKodu="123">
             <CustomButtons>
             <bimsa:CustomButton ID="statuGuncelle" Text="Okundu Yap / Okunmadı Yap">
             </bimsa:CustomButton>
            </CustomButtons>
            </bimsa:CommandColumn>
        </Columns>

我有一个自定义按钮,其 id 是statuGuncelle,当我点击它时,我想使用此事件更改此按钮上的文本

C#

protected void StatuGuncelleCallBack(object sender, ASPxGridViewCustomButtonCallbackEventArgs e)
{
       BIMSA.Web.UI.Controls.GridViewBase grd = (BIMSA.Web.UI.Controls.GridViewBase)sender;
       var key=grd.GetRowValues(e.VisibleIndex, grd.KeyFieldName);

...................
4

1 回答 1

1

我已经解决了使用此代码的问题。

gridYorum.CustomButtonInitialize += new ASPxGridViewCustomButtonEventHandler(gridYorum_CustomButtonInitialize);

void gridYorum_CustomButtonInitialize(object sender, ASPxGridViewCustomButtonEventArgs e)
    {
        String statu = gridYorum.GetRowValues(e.VisibleIndex, "Statu").ToString();
        if (statu == "Okundu")
        {
            e.Text = "Okunmadı yap";
        }
}
于 2013-10-22T11:38:03.447 回答