Forms Data Controls :: Getting Gridview Column Position

Jun 7, 2010

I have a gridview bound with sql data. The data size fluctuates very much depending on certain parameters, thus the gridview columns often vary in width. What I need to do is be able to get the location of a gridview column so I can line it up with a textbox underneath it. I realize this sounds like a footer but for a number of reasons I cannot use a footer. Is there a way I can dynamically get the location on the page of the start of a particular column so that I can place a textbox in this same location?

View 4 Replies


Similar Messages:

Forms Data Controls :: Finding The Position Of A Column Name In A Gridview

Dec 2, 2010

I have a gridview with the following information

NAME AGE

JOHN 22

ADAM 21

LISA 26

Now, I would like to find the position of NAME in the this gridview

I tried doing this

int index = 0

index = Convert.toInt32( GridView1.FindControl("Name").toString())

but that isnt working. Kindly note, I do not want to hardcord the position as 0, instead I would like to find it

View 2 Replies

Forms Data Controls :: Position The Second Gridview Next To The First Gridview's Selected Row

Jun 7, 2010

I have 2 gridviews, the first gridview is row-selectable. When selected it displays some details in a second gridview. What I need to do is position the second gridview next to the first gridview's selected row.

View 7 Replies

Forms Data Controls :: >>>want To Display Gridview Column Heading When Mouse Over To The Particular Column In The Gridview?

Oct 12, 2010

I want to display gridview column heading when mouse over to the particular column in the gridview.I am working in VisualStudio 2005 with MS.Net2.0 framework.I don't want to use ajax.

View 4 Replies

Forms Data Controls :: Adding A New Row In Gridview At Any Position?

Jun 16, 2010

i am using a gridview without any template or bound field....

<asp:GridView
ID="grvSchedule"
runat="server"
CellPadding="3"
CellSpacing="1"
SkinID="GridView_Regular" Width="732px">
<Columns>
<asp:TemplateField......

here the template field i added for hidden column... but i am not setting any values to this hidden field. i am setting the values to the grid from code behind like this....

grvSchedule.Rows[j].Cells[0].Text = Convert.ToString(dTable.Rows[i]["PatientId"]);
grvSchedule.Rows[j].Cells[2].Text = Convert.ToString(dTable.Rows[i]["Name"]);
grvSchedule.Rows[j].Cells[3].Text = Convert.ToString(dTable.Rows[i]["PatCode"]);
grvSchedule.Rows[j].Cells[4].Text = Convert.ToString(dTable.Rows[i]["Phone"]);
grvSchedule.Rows[j].Cells[5].Text = Convert.ToString(dTable.Rows[i]["Mobile"]);
grvSchedule.Rows[j].Cells[6].Text = Convert.ToString(dTable.Rows[i]["Status"]);
grvSchedule.Rows[j].Cells[7].Text = Convert.ToString(dTable.Rows[i]["Comments"]);

i need to add a new row at 0 position in gridview if a condition satisfies..... Condition is

if ((i == 0) && (Convert.ToDateTime(dTable.Rows[i]["Time"])
< Convert.ToDateTime(grvSchedule.Rows[j].Cells[1].Text)))
{
Here i need to add a new row to a 'GRIDVIEW'
}

View 8 Replies

Forms Data Controls :: Position GridView After DataBind?

Mar 7, 2011

I have a gridview positioning issue that may have been answered elsewhere, but I couldn't seem to find a similar post...

I have a webforms app containing a paged gridview (e.g., 200 records - 50 rows and 4 pages).

When the user clicks on a button in a specific row, another web page is launched to process that button click. When the user closes that page to return to the main gridview, the databind event is rerun and the page redisplays the gridview starting at the top. However, I want to have the previous position maintained (like an html bookmark), so that the grid will automatically be scrolled to the the previously clicked gridview page and item.

Setting attributes such as "MaintainScrollPositionOnPostback" do nothing in this case.

View 1 Replies

Forms Data Controls :: Gridview 2nd Column Decrease After Expanding The 3rd Column's Gridview?

Oct 29, 2010

[Code]....

Main Gridview[Code]....

View 3 Replies

Forms Data Controls :: Controlling Scroll Position Of Gridview

Jan 13, 2011

I have a gridview inside a div and everytime i scroll to the bottom rows of gridview, it throws back to the top of the grid.

<div id="divGvIncidentDetail" runat="server" style="overflow:scroll; min-height: 10px; max-height: 250px;" onscroll="SetDivPosition()">
<asp:GridView ID="gvIncidentDetail" runat="server" ...>
</asp:GridView>
</div>

To prevent it, i tried implementing following javascript code by user Sun Rays:

<script type="text/javascript">
window.onload = function () {
var strCook = document.cookie;
if (strCook.indexOf("!~") != 0) {
var intS = strCook.indexOf("!~");
var intE = strCook.indexOf("~!");
var strPos = strCook.substring(intS + 2, intE);
document.getElementById("divGvIncidentDetail").scrollTop = strPos;
}
}
function SetDivPosition() {
var intY = document.getElementById("divGvIncidentDetail").scrollTop;
document.title = intY;
document.cookie = "yPos=!~" + intY + "~!";
}
</script>

I get the following error when i run the code: Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object Am i missing something? or is there any other better solution to maintain the scroll position

View 9 Replies

Forms Data Controls :: Gridview Column Change / Replace A Column Data Field Value to 'Not Applicable'?

Jan 6, 2011

I have a gridview which is binded to a Sqldatasource. I would like to replace a column data field value to 'Not Applicable' if that column has got a value of 2 in database.

View 2 Replies

Forms Data Controls :: >>>Display Gridview Column Heading When MouseOver On Particular Column?

Oct 12, 2010

want to display gridview column heading when mouse over to the particular column in the gridview.

View 9 Replies

Forms Data Controls :: Add A Button At First Column Of Gridview And Get Cell Value In Another Column

Jul 22, 2010

How to add a button at first column of gridview and get cell value in another column?

For example, add a button named it as "Click me". Once user clicks will get third column cell's (ID) value.

View 2 Replies

Forms Data Controls :: Make A GridView Column Invisible If Every Cell In That Column Is Empty?

Mar 4, 2011

No sense in showing a competely blank column. how to make a GridView column invisible if every cell in that column is empty?

View 3 Replies

Forms Data Controls :: Display Text In 2 Rows And Then A Gridview Column - Third Row Is Displayed As A Row Under First Column

Jul 14, 2010

I have a gridview with 3 columns. In second column I want to display some text in 2 rows and then a gridview.
Here is my code:

[Code]....

The problem is my third row is displayed as a row under first column. How do I make it a separate column in my girdview. Not sure what is going wrong.

View 11 Replies

Forms Data Controls :: Gridview Column Validation When The Sum Of Column Value Is More Than 100?

Jan 8, 2011

I am using GridView ,I want to do a validation like if i edit any one of the Cell in that column, it will through the validation when the sum of column value is more than 100. How can i do this validation?

View 10 Replies

Forms Data Controls :: Retain Scroll Position Of Gridview During Postbacks In Firefox - Chrome

Feb 3, 2011

I have a gridview with scroll enabled. Means i have a gridview like this-

[Code]....

I want during postbacks scroll position of my gridview will not change. I have tried many articles on the web, but in some scrolling is retained only in IE, in some others scrolling position changes on clicking edit link of gridview. I want a good solution for IE, FF, Chrome

View 1 Replies

Forms Data Controls :: How To Restore Gridview Vertical Position After Clicking Edit Link Button

Oct 15, 2010

Is there any way to stop Gridview to turn back to first row when user click edit link button. Say there are 50 rows in gridview, user scrolled down to 45th row then click edit button. Gridview shifted to editmode but user need to roll down back again to reach the row 45th.

View 1 Replies

Data Controls :: Rotate GridView Rows Into Column With Image Column

Apr 27, 2016

I saw post [URL] .... which is converting rows into column item,quantity ,price. I have one other image field .how can bind image in this program?

View 1 Replies

Data Controls :: How To Hide Column In GridView And Access Value Of Hidden Column

Aug 16, 2013

As per my requirement, I am getting CompID, Company Name and URL from SQL database. I want to display just CompName and URL in gridvew. So, I need to hide the CompID in gridview. One way I can do BoundField field Visible to false but I need to retrive that compID id when user selected any of the row. if I set visible to false user wont see any compID in gridvew but I want access the selected compID also using SelectedRow.Cells[1].Text..

View 1 Replies

Data Controls :: Change Value Of GridView BoundField Column Based On Value From Another Column

May 7, 2015

I am using item template and eval function in the gridview to display the records. Can I add a coulmn which is not in the table?

I have to add some columns which is not in the table and assign the values from code behind to that particular column

View 1 Replies

Data Controls :: Get Column Index Of A Selected Column In GridView

Feb 3, 2014

I have a grid view with 4 columns and 12 rows.  Getting the row index is not problem; ;however, I cannot find a way to get the column index of the cell that i select.

View 1 Replies

Forms Data Controls :: To Add Insert Button To A GridView And A Scroll Bar To A Given Gridview Column?

Jul 9, 2010

how to implement Insert feature to a grid view?I need to use fields with scroll bar inside of a grid view. Is that possible through the template field?

View 23 Replies

Forms Data Controls :: Decrypt One Gridview Column Values Before Displaying It In The Gridview?

Mar 8, 2011

I have one filed that is encrypted using Rajindal algorithm and stored in MSSQL db.When I retrieve that column in gridview it's displayed in encrypted. I have the code that decrypts it but the problem is:How can I all loop throw this column values in the gridview and decrypt them all and display it in the gridview decrypted.See my code below:

[Code]....

View 9 Replies

Forms Data Controls :: GridView And ObjectDataSource - Column Is Not Shown In The GridView's List ?

Feb 9, 2011

I'm facing a wierd problem with GridView and ObjectDataSource. I bind GridView to my business objects via ObjectDataSource. Everything was working fine until I decided to add a new field in my buisness object and wanted to add a column to GridView to show it. Somehow that column is NOT shown in the GridView's list of available columns. I have tried refreshing schema, rebinding, etc. I'm using GridView inside a user control which is used as a web part. Does that make a difference ?

View 3 Replies

Forms Data Controls :: Get Value Of Column From Gridview

Jan 28, 2010

I want to use a value of a column from a selected row in a gridview as default value of a dropdownlist on a form on the same page. how to get this done in VB?

View 4 Replies

Forms Data Controls :: How To Get Column Value Of Gridview In C #

May 9, 2010

How to Get Column value of gridview in c #

[Code]....

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved