Click here to Skip to main content
15,914,481 members
Home / Discussions / C#
   

C#

 
GeneralRe: design changes in runtime!!! Pin
spif200123-Jan-05 20:34
spif200123-Jan-05 20:34 
GeneralRe: design changes in runtime!!! Pin
Jassim Rahma25-Jan-05 1:30
Jassim Rahma25-Jan-05 1:30 
QuestionHow to scroll a windows form? Pin
E6AD22-Jan-05 10:06
E6AD22-Jan-05 10:06 
AnswerRe: How to scroll a windows form? Pin
Stefan Troschuetz23-Jan-05 0:06
Stefan Troschuetz23-Jan-05 0:06 
Generalneed beginner's treeView help Pin
SuperStruct22-Jan-05 9:03
SuperStruct22-Jan-05 9:03 
GeneralRe: need beginner's treeView help Pin
mav.northwind22-Jan-05 11:19
mav.northwind22-Jan-05 11:19 
GeneralRe: need beginner's treeView help Pin
SuperStruct26-Jan-05 5:23
SuperStruct26-Jan-05 5:23 
GeneralCreating Custom DataGrid Column Pin
Anonymous22-Jan-05 8:19
Anonymous22-Jan-05 8:19 
Hi all,

I'm developing a custom DataGrid Column, that hosts a custom IPAddress Control.


I Should override the Paint mathod to paint the desiered text on the GridColumn

when the Paint method is called because the DataGrid USer clicks the last row in the grid to insert a new value.

i retrieve the value from the Column using "GetColumnValueAtRow ( source,rowNum )" and Paint it as shown in the code below.

i handled the problem of retrieving an invalid value but assign the NullText property that i previosly set.

But still the Paint draws 4 extra empty rows instead of only one.

anyway seems that i'm not handling the Paint method properly so does anyone knows how i should handle the Paint method when the User clicks on the last row in the DataGrid to insert a new value.


protected override void Paint
(
Graphics g,
Rectangle bounds,
CurrencyManager source,
int rowNum,
Brush backBrush,
Brush foreBrush,
bool alignToRight
)
{
try
{
string strIPAddress = "" ;


try
{
strIPAddress = ( string ) GetColumnValueAtRow ( source,
rowNum ) ;
}
catch
{
strIPAddress = this.NullText ;
}

Rectangle rect = bounds ;

g.FillRectangle ( backBrush,rect ) ;

rect.Offset ( 0, 2 ) ;
rect.Height -= 2 ;

g.DrawString ( strIPAddress ,
this.DataGridTableStyle.DataGrid.Font,
foreBrush,
rect ) ;
}
catch
{
System.Diagnostics.Debug.Assert ( false ) ;
}
}

Generalsimple question about serviceName when developing a win service Pin
liyang yu22-Jan-05 8:10
liyang yu22-Jan-05 8:10 
GeneralRe: simple question about serviceName when developing a win service Pin
Andy Brummer23-Jan-05 19:03
sitebuilderAndy Brummer23-Jan-05 19:03 
GeneralAccess database Pin
webhay22-Jan-05 4:43
webhay22-Jan-05 4:43 
GeneralRe: Access database Pin
Colin Angus Mackay22-Jan-05 8:04
Colin Angus Mackay22-Jan-05 8:04 
Questionhow to package the C# application and MS-SQL(7) ?? Pin
Shahrouz Sadeghi22-Jan-05 4:37
Shahrouz Sadeghi22-Jan-05 4:37 
AnswerRe: how to package the C# application and MS-SQL(7) ?? Pin
Nick Parker22-Jan-05 6:47
protectorNick Parker22-Jan-05 6:47 
GeneralRe: how to package the C# application and MS-SQL(7) ?? Pin
Shahrouz Sadeghi24-Jan-05 21:46
Shahrouz Sadeghi24-Jan-05 21:46 
GeneralParsing Word documents Pin
Member 159449022-Jan-05 4:27
Member 159449022-Jan-05 4:27 
GeneralRe: Parsing Word documents Pin
Andy Brummer23-Jan-05 18:59
sitebuilderAndy Brummer23-Jan-05 18:59 
QuestionSet VScrollBar & HScrollBar colors? Pin
bbzzdd22-Jan-05 4:25
bbzzdd22-Jan-05 4:25 
AnswerRe: Set VScrollBar & HScrollBar colors? Pin
Nick Parker22-Jan-05 6:42
protectorNick Parker22-Jan-05 6:42 
GeneralListView Pin
Newbie_Toy22-Jan-05 4:00
Newbie_Toy22-Jan-05 4:00 
QuestionHow to call a function in VC++ DLL from C# Pin
Anonymous22-Jan-05 1:44
Anonymous22-Jan-05 1:44 
GeneralMarshalling of SAPI4 interfaces/structs Pin
mav.northwind22-Jan-05 0:09
mav.northwind22-Jan-05 0:09 
Generalprogress bar Pin
Newbie_Toy21-Jan-05 19:35
Newbie_Toy21-Jan-05 19:35 
GeneralRe: progress bar Pin
Dave Kreskowiak23-Jan-05 6:28
mveDave Kreskowiak23-Jan-05 6:28 
GeneralCAD programming with C# Pin
Abhinandan_Shah21-Jan-05 19:19
Abhinandan_Shah21-Jan-05 19:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.