aspxgridview

Replacing HeaderText with Headertemplate in TemplateField

二次信任 提交于 2019-12-10 17:14:49
问题 I have a gridview with templatefield columns. The TemplateFields are something like this: <asp:TemplateField HeaderText="Title" SortExpression="name" meta:resourcekey="BoundFieldResource1"> <ItemTemplate> <asp:Label ID="lblTitle" runat="server" Text='<%# Bind("Name") %>' meta:resourcekey="BoundFieldResource1"></asp:Label> </ItemTemplate> I have to add a custom attribute for to the header of this columns so I removed HeaderText and added the following: <Headertemplate> <asp:Label ID=

How to get field value of selected Row Devexpress GridView?

巧了我就是萌 提交于 2019-12-10 13:43:41
问题 I use a DevexpressGridView to display all TOPIC (id,title,content) <dx:ASPxGridView ID="gv" runat="server" OnSelectionChanged="gv_SelectionChanged" > I have grid_SelectionChanged event: protected void gv_SelectionChanged(object sender, EventArgs e) { int id= selected row...???; //how can I get the value of selected row string sql = "select * from TOPIC where idTOPIC="+id; DataTable topic = l.EXECUTEQUERYSQL(sql); TextBox1.Text = topic.Rows[0][1].ToString(); } ... It seems gv.SelectedRow

set column width of a gridview in asp.net

时光总嘲笑我的痴心妄想 提交于 2019-12-08 15:29:04
问题 I dragged and dropped a GridView from toolbox to Aspx page.the design code looks like this <asp:GridView ID="gridview1" runat="server" style="text-align:center;width: 1327px;" CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True" EnableSortingAndPagingCallbacks="True" PageSize="50" AutoGenerateEditButton="True"> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> <EditRowStyle BackColor="#999999" /> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White

DevExpress AspxGridView filter in ObjectDataSource

微笑、不失礼 提交于 2019-12-08 09:14:29
问题 Yet another problem with DevExpress AspxGridView :) The context: One Page In the Page, a custom control In the custom Control, a AspxDropDown The AspxDropDown has a DropDownWindowTemplate In the DropDownItemTemplate , I add a GridView and a paging/sorting/filtering enabled ObjectDataSource When handling the selecting event of the ObjectDataSource , I should set filter parameters for the datasource. There filter parameters should come from the FilterRow of the AspxGridView (preferably using

Binding GridViewComboBoxColumn to a datasource

…衆ロ難τιáo~ 提交于 2019-12-08 03:15:50
问题 I already know how to specify the datasource but afther doing that it is not populated yet so i was thinking you need some kind of bind() command to populate the comboboxcolumn in the edit form This below is how i bind the datasource to the comboboxcolumn (and yes i am sure that ds has data rows in it) (ASPxGridView4.Columns["Naam"] as GridViewDataComboBoxColumn).PropertiesComboBox.DataSource = ds as DataSet; So could anyone tell me how i can now populate the comboboxcolumn in edit mode? Edit

Find checkbox control in ASPxGridView

ε祈祈猫儿з 提交于 2019-12-02 12:37:08
问题 I have a AspxGridView that has a checkbox dataitemTemplate inside a gridViewDatacheckColumn. Now I want to find that control for each row and uncheck/check them on runtime. Here's my code for the ASPxGridView: <dx:ASPxGridView ID="RadGrid2" runat="server" AutoGenerateColumns="False" ClientInstanceName="grid" KeyFieldName="StoreID" SettingsPager-Mode="ShowAllRecords" Width ="50%"> <Settings ShowVerticalScrollBar="true" /> <Columns> <dx:GridViewDataCheckColumn Caption="#" VisibleIndex="0" Width

Find checkbox control in ASPxGridView

耗尽温柔 提交于 2019-12-02 04:03:10
I have a AspxGridView that has a checkbox dataitemTemplate inside a gridViewDatacheckColumn. Now I want to find that control for each row and uncheck/check them on runtime. Here's my code for the ASPxGridView: <dx:ASPxGridView ID="RadGrid2" runat="server" AutoGenerateColumns="False" ClientInstanceName="grid" KeyFieldName="StoreID" SettingsPager-Mode="ShowAllRecords" Width ="50%"> <Settings ShowVerticalScrollBar="true" /> <Columns> <dx:GridViewDataCheckColumn Caption="#" VisibleIndex="0" Width ="25%"> <DataItemTemplate> <dx:ASPxCheckBox ID="CheckBox1" runat="server"> </dx:ASPxCheckBox> <

How to remove row from gridview on row command event?

房东的猫 提交于 2019-11-29 17:29:38
I am trying to remove row from gridview by click on ImageButton which is placed inside gridview. I am getting row index but dont know how to remove. My gridview binds from session and i dont want to rebind gridview. Here is my code: protected void GVDetail_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Remove")) { List<Class1> list = (List<Class1>)Session["value1"]; int index = Convert.ToInt32(e.CommandArgument); GridViewRow gridRow = gvDetail.Rows[index];// (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); ((List<Class1>)Session["value1"])

How to remove row from gridview on row command event?

荒凉一梦 提交于 2019-11-28 12:45:11
问题 I am trying to remove row from gridview by click on ImageButton which is placed inside gridview. I am getting row index but dont know how to remove. My gridview binds from session and i dont want to rebind gridview. Here is my code: protected void GVDetail_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Remove")) { List<Class1> list = (List<Class1>)Session["value1"]; int index = Convert.ToInt32(e.CommandArgument); GridViewRow gridRow = gvDetail.Rows[index];//

ASP.NET GridView: How to edit and delete data records

倖福魔咒の 提交于 2019-11-27 02:11:01
Hi I have used gridview to create a table. Is there a way to implement edit and delete. I have done it in PHP before. The method I would like to use is create two more columns in the table with edit and delete buttons on each row. Then when the buttons are click it passes the 'id' through the URL and able to edit or delete. Not really sure how to do this in asp.net webforms. Below is my code for the table. Thank you. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Surgery" DataField="surgery" /> <asp:BoundField HeaderText=