473,325 Members | 2,774 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,325 software developers and data experts.

How to color the corner of the datagridcell

51
hey can ne1 tell me how to color the corner of a cell in the datagridview
Nov 25 '08 #1
13 1699
kenobewan
4,871 Expert 4TB
Sounds like a job for CSS?
Nov 25 '08 #2
Curtis Rutland
3,256 Expert 2GB
@kenobewan
Well, a DataGridView is a Forms control, not a web control, so I don't think CSS will work...
Nov 25 '08 #3
Plater
7,872 Expert 4TB
It sounds like something for OwnerDraw, which can get nasty with an object that complex I would think
Nov 25 '08 #4
kenobewan
4,871 Expert 4TB
@insertAlias
Ok you caught me bluffing, I was thinking of using a gridview template with CSS applied to it:
ASP.NET Gridview and CSS
Nov 27 '08 #5
PRR
750 Expert 512MB
@Smish
DataGrid.OnItemDataBound Method (System.Web.UI.WebControls)
Check this ... you could change the cell[index] color in this ...
Sample Gridview function
Expand|Select|Wrap|Line Numbers
  1.  protected void g1_RowDataBound(object sender, GridViewRowEventArgs e)
  2.     {
  3.         if (e.Row.RowType == DataControlRowType.DataRow)
  4.         {
  5.  
  6.             if (e.Row.Cells[1].Text == "DDD")
  7.             {
  8.                 e.Row.Cells[1].BackColor = System.Drawing.Color.Black;
  9.                 e.Row.Cells[1].Enabled = false;
  10.             }
  11.  
  12.         }
  13.     }
  14.  
corner ? well i guess i got it wrong here.. Moderator please delete my post as its irrelevant..
Nov 27 '08 #6
kenobewan
4,871 Expert 4TB
Correct me if I am wrong, but the OP talked about coloring the corner of a cell and not the whole cell. One way to do this would be to apply a background image through CSS. Perhaps we need the amount/ shape of the coloring defined to be sure.
Nov 29 '08 #7
Plater
7,872 Expert 4TB
Did we forget we are talking about a windows form control, not a web control again?
At any rate we might until the OP actually gets back to us.
Dec 1 '08 #8
kenobewan
4,871 Expert 4TB
@Plater
Not sure how you ascertained that it was a windows form control from OP, although InsertAlias implied it was.

Smish - please reply to your post urgently, your experts need you!
Dec 2 '08 #9
Plater
7,872 Expert 4TB
@kenobewan
The DataGridView object is a windows forms only object.
The DataGrid was in .net1.x and was used in both windows form and web application (but was a very poor object)
The GridView object is for web applications
Dec 2 '08 #10
Smish
51
Hey guys ...
sorry for the delay in replying....and thanx for the response..

I want it for Windows object datagridview control.if i get to know how do we color the corner of a cell.Like suppose i want to show there are two or more indication to be given to the cell.so i was thinking ill start from lower right corner.for 1st indication ill color red,the next line ill color blue and so on..

hope its clear now..thanx
Jan 1 '09 #11
kenobewan
4,871 Expert 4TB
Thanks for clearing that up. Now all you need to do is follow the advice of those who correctly assumed you were using a windows datagridview :).
Jan 1 '09 #12
Smish
51
But i dont want an css to be aplied it would be cumbersome..is ther any way to paint the points in the cell by specifyign a region??
Jan 1 '09 #13
kenobewan
4,871 Expert 4TB
And those above who agreed that CSS was not the solution were correct...
Jan 2 '09 #14

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

Similar topics

6
by: rzed | last post by:
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black...
3
by: Mad Scientist Jr | last post by:
Can someone post a clear example of how to change the background color of an individual datagrid cell for a Windows desktop app? (preferably in vb.net) I found some code on how to do this when...
1
by: Karl | last post by:
Hi there, I have a problem needs help. In a winform, I have a datagrid. In Mouse move event, I can get coodinates of Mouse. I want to decide which datagridcell my mouse is on. Can anybody...
0
by: qwu2008 | last post by:
All, I wanted to create a browser helper object that has a clickable icon at the right corner of the browser (similar to the Google notebook icon at the right corner of the browser). When the user...
3
by: laredotornado | last post by:
Hi, I was recently exploring JQuery and the rounded corner plugin -http:// methvin.com/jquery/jq-corner-demo.html, unfortunately, this plug-in seems to only apply to rounding corners in the...
1
by: igpig | last post by:
Sorry if this has been asked before. I've searched the group and the FAQ and didn't find the answer. How can I retrieve x, y coordinates of the browser top left corner in Internet Explorer? ...
0
by: =?Utf-8?B?UmljaA==?= | last post by:
In a datagridview, the first column header cell is columnHeader(0), which is immediately to the right of the Top Left Corner Select All cell. And the first RowHeader cell is RowHeaderCell(0) which...
4
by: Andre Majorel | last post by:
How do you align an <imgagainst the bottom-right corner of an enclosing block so that the text in the block flows around it ? <!-- Block begins here --> <p> En ce qui concerne la conjoncture...
11
by: Simon van Beek | last post by:
Dear reader, By opening an application I get always the main Access window with the closing cross in the above right corner. Is there a possibility to make this closing cross invisible? ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.