473,387 Members | 1,365 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,387 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 1701
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.