473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

problem with datagrid

HI
i am new to VS.NET 2005 .I can move controls over a aspx form in .NET 2002 easily but i cant do like that in .NET 2005.I wanted to move a gridview but i couldnt.so i alighned it center.is there any way of moving gridview and other controls?

one more qsn pls

how can i display some string value in a cell in a gridview.i can populate a dataset.but in only one cell i need to populata a stringa value instead of dataset values is it possible?
Aug 8 '07 #1
1 851
Plater
7,872 Expert 4TB
You can edit the values in your gridview after you bind them.
In the following function I look in my gridview: gvOverdueSites for a column called "Return Date". I then go through all my data and change the forecolor to red.
I also change my first column values to a different value
Expand|Select|Wrap|Line Numbers
  1. protected void procOverdueSites()
  2.     {
  3.         string msg = "";
  4.         int retdateidx = -1;
  5.         if (gvOverdueSites.HeaderRow != null)
  6.         {
  7.             for (int i = 0; i < gvOverdueSites.HeaderRow.Cells.Count; i++)
  8.             {
  9.                 if (gvOverdueSites.HeaderRow.Cells[i].Text == "Return Date")
  10.                 {
  11.                     retdateidx = i;
  12.                 }
  13.             }
  14.             for (int i = 0; i < gvOverdueSites.Rows.Count; i++)
  15.             {
  16.                 if (retdateidx > -1)
  17.                 {
  18.                     gvOverdueSites.Rows[i].Cells[retdateidx].ForeColor = System.Drawing.Color.Red;
  19.                 }
  20.                 msg = gvOverdueSites.Rows[i].Cells[0].Text;
  21.                 if (gvOverdueSites.HeaderRow.Cells[0].Text == "SiteID")
  22.                 {
  23.                     gvOverdueSites.Rows[i].Cells[0].Text="New Stuff"+msg;
  24.                 }
  25.             }//end of forloop
  26.         }
  27.     }
  28.  
Aug 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
0
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some...
1
by: Joe Bloggs | last post by:
I am trying display the contents of a table in a web page, select certain rows from that table and then display the fields that I have selected (now table columns) as text in a Label object....
5
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
7
by: Neo Geshel | last post by:
Greetings. I have a serious problem. I have multiple sets of tables, several of which are chained more than two tables deep. That is, I have a parent, a child, and a great-grandchild table. ...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.