gridview

AsyncPostBackTrigger works only the first time

本小妞迷上赌 提交于 2019-12-24 01:51:11
问题 I have an update panel that includes a gridview. This grid has a drop down list column. Beta aspx code: <asp:UpdatePanel ID="UpdatePanel1" runat="server" EnablePartialRendering="false" UpdateMode="Conditional"> ... <asp:GridView ID="Gv_Queue" runat="server"> <Columns> <asp:TemplateField HeaderText="H"> <ItemTemplate> <asp:DropDownList ID="ddl_proprietà" runat="server" OnSelectedIndexChanged="ddl_proprietà_SelectedIndexChanged" AutoPostBack="true"/> </ItemTemplate> </Columns> </asp:GridView <

GridView LostFocus and GotFocus events

自古美人都是妖i 提交于 2019-12-24 01:49:20
问题 The GridView GotFocus and LostFocus seem to fire each time focus is shifted from one GridViewItem to another. Is there any way to know when a GridView as a whole received and lost focus? MyGridView.GotFocus += MyGridView_GotFocus; MyGridView.LostFocus += MyGridView_LostFocus; The above events MyGridView_GotFocus & MyGridView_LostFocus fires each time focus is moved from one GridViewItem to another in MyGridView 回答1: Is there any way to know when a GridView as a whole received and lost focus?

gridview findcontrol returning empty “”

廉价感情. 提交于 2019-12-24 01:47:23
问题 i am trying to read from a textbox within a gridview by using this code protected void Button1_Click(object sender, EventArgs e) { foreach (GridViewRow row in GridView1.Rows) { string textBoxText = ((TextBox)row.FindControl("numTC")).Text; Response.Write(textBoxText); } } this code keeps returning "" (empty) any idea why this is hapenning? Thanks 回答1: Make sure that you are not re-binding the GridView on the PostBack of the page. This may be the issue. EDITS Make sure that the code for

How to display text in a WPF GridView that contains carriage returns

大兔子大兔子 提交于 2019-12-24 00:59:37
问题 I have a grid view that has two simple columns, a report number and a short description. It is common for this short description to have some carriage returns. If that is the case, I would like the row to expand its height to fit all of the text in. Currently the field renders with possibly the first line displaying, but then cutting off text below it. How could I display all the text, with it adjusting the height as needed? And can this be done on a per-row basis, as in, if the next report

Save each row in gridview that was built manually

房东的猫 提交于 2019-12-24 00:58:57
问题 I'm trying to save multiple rows from a gridview into sql database. The gridview is manually built in code, thus it is not databind... The reason for this is because this is a grid for parts that has to be added to a quote... Okey so I done the saving part, the only thing is, is that I have to set a foreach to get the data from that row (which I done), but the variables will be set constantly and only getting the last rows data... Can anybody please help me out? This is what I've done: conn =

Export Grid View to Excel

回眸只為那壹抹淺笑 提交于 2019-12-24 00:53:34
问题 Need help bringing my gridview into a excel document. Ive tried several example and can't seem to get it right. Any help would be much appreciated. Here is my gridview code, it is being populated from a SQL database. <div> <asp:GridView Align="Center" ID="gvResults" AutoGenerateColumns="false" runat="server" Width="608px" Style="width: 80%; margin-bottom: 0px" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowDataBound="gvResults_RowDataBound"> <AlternatingRowStyle BackColor="White"

HorizontalScrollView shrinks GridView to small line

与世无争的帅哥 提交于 2019-12-24 00:49:13
问题 When I put a HorizontalScrollView around a GridView, the GridView gets compressed into a small column on the left. The Gridview's vertical scrollbar even appears on the left. The HorizontalScrollView's width is set to fill_parent and the GridView is also fill_parent. I don't know why this is happening. I tried setting the GridView's visibility to GONE and VISIBILE like someone recommended but it doesn't do anything. However if fastScroll is enabled on the GridView, then dragging the fast

How to know GridView numColumns before setting up adapter in case of auto_fit?

北城余情 提交于 2019-12-24 00:49:11
问题 I am using GridView in my Android project, which is having auto_fit properties set for numColumns (with columnWidth set to 48dp). I wanted to know numColumns value before setting up adapter, so I can setup values size. but If I call it inside onCreateView is gives as -1 @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); int numColumns = gv.getNumColumns(); if

OnSwipeTouchListener does not work for a GridView of Button objects?

霸气de小男生 提交于 2019-12-24 00:48:28
问题 DISCLAIMER: I am aware that this post may be long compared to others, but I honestly could not find any post in SO that was helpful (recommended links welcome!), and I also could not find any other way to break this problem down any simpler... That said, I would greatly appreciate it if you could help me out as I have been stuck on this issue for quite awhile now... For an array of String values in GridView (Linear Layout - vertical), I implemented the OnSwipeTouchListener class for swiping

ViewGroup throwing NullPointerException in dispatchDragEvent

≡放荡痞女 提交于 2019-12-24 00:47:31
问题 I am in the process of coding a drag and drop library for GridViews. I am almost complete...however, I am getting an annoying NullPointerException upon ACTION_DROP every now and then. It points to the ViewGroup source code, lines 1147 and 1153, saying it is getting a null pointer when trying to recycle the drag event. Some background on my process: I am basically embedding an OnDragListener into a custom adapter for a GridView. I have the user (programmer) implement an OnGetViewListener, when