本文介绍了在Devexpress ASPxGridView中查找控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含ASPxGridView和ASPxCheckBox和Label的代码,例如:
I have a code that contains an ASPxGridView and a ASPxCheckBox and Label within in like:
<dx:ASPxGridView ID="gvTableSearchHomes" runat="server" DataSourceID="XmlHomes" Width="341px"
CssClass="tableViewSearchGrid" ClientInstanceName="gvTableSearchHomes"
AutoGenerateColumns="False" EnableRowsCache="false" KeyFieldName="ID">
<%--<Columns>--%>
<%-- DXCOMMENT: Within ASPxGridView, add a column whose values will participate in filtering --%>
<%--<dx:GridViewDataTextColumn FieldName="Address">
<PropertiesTextEdit NullText="Search your home"></PropertiesTextEdit>
<Settings AllowAutoFilterTextInputTimer="True" AutoFilterCondition="Contains" />
</dx:GridViewDataTextColumn>
</Columns>--%>
<Templates>
<%--DXCOMMENT: Configure the grid's DataRow template in accordance with data source fields --%>
<DataRow>
<div class="gvItem">
<dx:ASPxCheckBox ID="ChkBookList" runat="server"></dx:ASPxCheckBox>
<dx:ASPxLabel ID="Address" runat="server" CssClass="address" Text='<%# Utils.ExtractFirstRow(Eval("Address")) %>' />
<%--<p><dx:ASPxLabel ID="Address2" runat="server" CssClass="address2" Text='<%# Utils.ExtractSecondRow(Eval("Address")) %>' /></p>
<p><dx:ASPxLabel ID="Price" runat="server" CssClass="price" Text='<%# Utils.GetPrice(Eval("Price")) %>' /></p>--%>
</div>
</DataRow>
</Templates>
<SettingsPager Visible="false" PageSize="1000" />
<Settings ShowVerticalScrollBar="True" ShowFilterRow="true" ShowColumnHeaders="false"/>
<SettingsBehavior AutoExpandAllGroups="true" AllowSelectSingleRowOnly="true" AllowSelectByRowClick="true"/>
<ClientSideEvents
Init="function(){ hr.TableViewLandscape_Adjust(); }"
EndCallback="function(){ hr.TableViewLandscape_Adjust(); }"
SelectionChanged="OnGvTableSearchHomesSelectedChanged" />
<Styles>
<SelectedRow ForeColor="White"></SelectedRow>
</Styles>
我无法通过C#代码访问这些控件。有谁能够帮助我。请
I am not able to access these cotnrols through C# code. Can anybody help me. Please
推荐答案
感谢我解决了mi问题。我把这个
thanks I solved mi problem. I put this
Protected Sub GvEncuesta_HtmlRowCreated(sender As Object, e As ASPxGridViewTableRowEventArgs)
If (e.RowType <> GridViewRowType.Data) Then Return
Try
Dim cmbRespuesas As ASPxComboBox = GvEncuesta.FindRowCellTemplateControl(e.VisibleIndex, Nothing, "ASPxCmbRespuestas")
cmbRespuesas.IncrementalFilteringMode = IncrementalFilteringMode.Contains
cmbRespuesas.Visible = True
cmbRespuesas.DataSource = wcfCap.RetrieveRespuestaEncuestaxEstado(1)
cmbRespuesas.ValueField = "Cod_Respuesta"
cmbRespuesas.TextField = "Nombre_Respuesta"
cmbRespuesas.DataBindItems()
Catch ex As Exception
End Try
End Sub
这篇关于在Devexpress ASPxGridView中查找控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!