Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How Auto scroll a cell content in Datagrid in C# Windows application ?
Posted
Updated 25-May-11 22:35pm
v13
Comments
OriginalGriff 5-May-11 9:06am    
Would you care to give us a little more information as to what you are trying to achieve.
What hind of grid, what do you mean by scroll text dynamically, that sort of thing.

Without shouting, by preference. It's the button on the left of your keyboard, below Tab and above Shift. Press it and the magic pixies will let you use lower case characters...
Nagy Vilmos 6-May-11 10:28am    
Can I have some Magic Pixies too?
OriginalGriff 6-May-11 10:31am    
Sure! Send me your number and I'll fax you a whole bunch...
(http://www.dilbert.com/fast/1994-09-25/)
Sandeep Mewara 5-May-11 10:56am    
Not clear.
musefan 5-May-11 12:18pm    
Not not unclear

1 solution

I assume you are asking to auto scroll a cell content in data grid, just like a marquee tag does in plain HTML. This can be achieved by modifying cell content in grid's ItemDataBound event (considering you are using ASP.Net native DataGrid control)

C#
private void grdYourGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
  if(e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer)
  {
     //Assuming you want to autoscroll content of Cell[0]
     e.Cells[0].Text = "<MARQUEE>" + e.Cells[0].Text + "</MARQUEE>"   
  }
}
 
Share this answer
 
v2
Comments
fjdiewornncalwe 18-May-11 8:54am    
If you want a better answer, I would suggest not marking this answer as "accepted" because that will drive other users away from looking at your question.
fjdiewornncalwe 18-May-11 15:04pm    
Not likely, you obviously didn't even read what I wrote in the comment above, you simply replied to it with the proverbial "Give Me". I don't respond well to that, sorry.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900