gridview

While doing asynchronous postback page losings gridviewscroll script?

半城伤御伤魂 提交于 2020-01-16 18:09:06
问题 While doing asynchronous postback page losings gridviewscroll script even after i did script register on code behind. (I have grid in update panel.. This happen when clicking "add new row" in asp.net grid view.) I have tried with the following three methods. ScriptManager.RegisterStartupScript(UpdatePanel_Objective, this.GetType(), UpdatePanel_Objective.UniqueID, "gridviewScroll();", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "gridviewScroll();", true);

WPF: Associating Grid selected element with unique treenode

▼魔方 西西 提交于 2020-01-16 16:47:06
问题 I am creating a tree by parsing a string separated by (.) Edit: public class TestElement{ public int Id { get; set; } public string Name { get; set; } public string Path { get; set; } public List<TestElement> Children { get; set; } public TestElement CurrentNode { get; set; } public TestElement Parent { get; set; } } In TestElement For example I have this data: public List<TestElement> GetTreeNodes() { var nodeElements = new List<TestElement>(); AddNode(nodeElements, 1, "a.b.c.value");

GridView paging not working proper

流过昼夜 提交于 2020-01-16 15:42:52
问题 I'm trying to make paging with GridView, and I have already added GridView's PageIndexChanging method, but the second page returns an empty page. What I'm doing wrong with this code ? protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; GridView1.DataBind(); } 回答1: This problem has solved when I added this private void FillGrid() { GridView1.DataSource = "Query..." GridView1.DataBind(); } And changed : protected void

GridView paging not working proper

ぐ巨炮叔叔 提交于 2020-01-16 15:42:25
问题 I'm trying to make paging with GridView, and I have already added GridView's PageIndexChanging method, but the second page returns an empty page. What I'm doing wrong with this code ? protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; GridView1.DataBind(); } 回答1: This problem has solved when I added this private void FillGrid() { GridView1.DataSource = "Query..." GridView1.DataBind(); } And changed : protected void

2 Dropdownlists in Gridview cause error: Databinding methods such as Bind() can only be used in the context of a databound control

与世无争的帅哥 提交于 2020-01-16 08:53:15
问题 Though this seems to be discussed before, I can't apply given help in my case: I have 2 DropDownLists (DDL1, DDL2) inside the Edit Template of a Gridview, which is bound to a SQLDataSource. DDL2 depends on the selected value of DDL1. If I place the SQLDataSources that populate the DropDownLists on the top level, the ControlID of DDL2's ControlParameter isn't found even though I address it correctly (Gridview$DDL1ControlID). Therefore I placed the SQLDataSources inside the Edit Template of the

GridView looses track of items in a NotIndexed location and many do not get displayed anymore

半城伤御伤魂 提交于 2020-01-16 08:53:14
问题 I am using for a UWP app the FileInformationFactory to retrieve a Virtualized vector of files object which are cast to a FileInformation and displayed in a GridView . I want to query a folder on a SD card plugged onto my laptop and compare the virtualization of the GridView when this folder is in a FullyIndexed location, such as my Desktop. This SD card has a folder containing 15,000 text files of zero bytes. Each file is named x.txt where x runs from 1-15000 (this can be generated in a

how to set width of template field in grid view in asp.net

这一生的挚爱 提交于 2020-01-16 08:48:51
问题 i have template field in grid view i want to reduce width to 20 px , how to reduce or set width of a template field in gridview? <asp:TemplateField HeaderText="Day Id"> <ItemTemplate> <asp:Label ID="LblDayId" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "DayId") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="lblEditDayId" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "DayId") %>'></asp:Label> </EditItemTemplate> <FooterTemplate > <asp:TextBox

How to attach a jQuery event to a grid view that is not visible on document ready?

a 夏天 提交于 2020-01-16 08:28:13
问题 I am trying to hook into a link in a gridview with jquery but the grid is in an update panel and not visible until the user runs a report. If I add the class ".myLink" to any other "a" tag it works fine, but as the gridview is not there at document.ready I am not sure where to call this from $(document).ready(function(){ $('a .myLink').click(function(){ var link = $(this).attr('href'); alert(link); return false; }); }); 回答1: You can use .live() to handle events on element created at any time,

execute sqldatasource with button

浪尽此生 提交于 2020-01-16 06:45:49
问题 I have two queries that I want to be able to run on a page. I have a button, gridview and sqldatasource at the top of the page and another button, gridview and sqldatasource with the second query at the bottom. How do I associate the buttons with their particular grid and datasource. right now when I click either button, both gridview1 and gridview2 populate. 回答1: I'm assuming in the markup for your grdiviews you have set the datasource property to one of the sql data sources. I'm also going

C# WinForm反射窗体控件gridView并对其增加列操作

╄→гoц情女王★ 提交于 2020-01-16 06:44:11
/// <summary> /// 在窗体中根据名称查找gridview需要增加的列 /// </summary> public void GetGridViewInWin() { try { BLL.SYS.ctlmWinAddColumn bllColumn = new BLL.SYS.ctlmWinAddColumn(); //取得窗体属性 Type FormType = this.GetType(); //取得所有控件 //FieldInfo[] fi = FormType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public); string FieldName=""; DataTable dtList = bllColumn.GetColumnByWinAndGridid(this.FindForm().GetType().FullName); //查找窗口控件数据列表 foreach (DataRow dr in dtList.Rows) { //取得指定名字的控件 FieldInfo fi = FormType.GetField(dr["gridViewId"].ToString().Trim(), BindingFlags.NonPublic |