In this code what do I have to do to get the read only and Height property
to work?
this is going into a datagrid.
Dim BOOKSLABEL As New ColoredTextBoxColumn
BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop
BOOKSLABEL.MappingName = "Label"
BOOKSLABEL.HeaderText = "Possible Fields"
BOOKSLABEL.Alignment = HorizontalAlignment.Left
BOOKSLABEL.TextBox.Height = 150
BOOKSLABEL.Width = 200
BOOKSLABEL.TextBox.ReadOnly = True 14 1276
Hi,
To set the row height adjust the tablestyle preferredrowheight. To make a
column readonly set the datagridtextboxcolumn readonly property to true.
Ken
---------------
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl... In this code what do I have to do to get the read only and Height property to work? this is going into a datagrid.
Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.TextBox.ReadOnly = True
Hi Ken,
Can we set one column to read only? We can set the back colr and such in the
code below for one column...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uK*************@TK2MSFTNGP09.phx.gbl... Hi,
To set the row height adjust the tablestyle preferredrowheight. To make a column readonly set the datagridtextboxcolumn readonly property to true.
Ken ---------------
"scorpion53061" <sc****************************@yahoo.com> wrote in
message news:u7**************@TK2MSFTNGP09.phx.gbl... In this code what do I have to do to get the read only and Height
property to work? this is going into a datagrid.
Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor =
System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.TextBox.ReadOnly = True
Hi,
Yes.
Ken
------------------------
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:Of*************@TK2MSFTNGP09.phx.gbl... Hi Ken,
Can we set one column to read only? We can set the back colr and such in
the code below for one column...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uK*************@TK2MSFTNGP09.phx.gbl... Hi,
To set the row height adjust the tablestyle preferredrowheight. To make
a column readonly set the datagridtextboxcolumn readonly property to true.
Ken ---------------
"scorpion53061" <sc****************************@yahoo.com> wrote in message news:u7**************@TK2MSFTNGP09.phx.gbl... In this code what do I have to do to get the read only and Height property to work? this is going into a datagrid.
Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.TextBox.ReadOnly = True
HI ken,
In this scenario,
Dim BOOKSLABEL As New ColoredTextBoxColumn
BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop
BOOKSLABEL.MappingName = "Label"
BOOKSLABEL.HeaderText = "Possible Fields"
BOOKSLABEL.Alignment = HorizontalAlignment.Left
BOOKSLABEL.TextBox.Height = 150
BOOKSLABEL.Width = 200
BOOKSLABEL.TextBox.ReadOnly = True
how would you have made this column read only?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:O0****************@TK2MSFTNGP12.phx.gbl... Hi,
Yes.
Ken ------------------------ "scorpion53061" <sc****************************@yahoo.com> wrote in
message news:Of*************@TK2MSFTNGP09.phx.gbl... Hi Ken,
Can we set one column to read only? We can set the back colr and such in the code below for one column...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uK*************@TK2MSFTNGP09.phx.gbl... Hi,
To set the row height adjust the tablestyle preferredrowheight. To
make a column readonly set the datagridtextboxcolumn readonly property to
true. Ken ---------------
"scorpion53061" <sc****************************@yahoo.com> wrote in message news:u7**************@TK2MSFTNGP09.phx.gbl... > In this code what do I have to do to get the read only and Height property > to work? > this is going into a datagrid. > > Dim BOOKSLABEL As New ColoredTextBoxColumn > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > BOOKSLABEL.MappingName = "Label" > BOOKSLABEL.HeaderText = "Possible Fields" > BOOKSLABEL.Alignment = HorizontalAlignment.Left > BOOKSLABEL.TextBox.Height = 150 > BOOKSLABEL.Width = 200 > BOOKSLABEL.TextBox.ReadOnly = True > >
Hi,
Assuming the column in question is inherited from the DataGridTextBoxColumn,
you can just set it's
ReadOnly property to True.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl... HI ken,
In this scenario, Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.TextBox.ReadOnly = True how would you have made this column read only?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:O0****************@TK2MSFTNGP12.phx.gbl... Hi,
Yes.
Ken ------------------------ "scorpion53061" <sc****************************@yahoo.com> wrote in message news:Of*************@TK2MSFTNGP09.phx.gbl... Hi Ken,
Can we set one column to read only? We can set the back colr and such
in the code below for one column...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uK*************@TK2MSFTNGP09.phx.gbl... > Hi, > > To set the row height adjust the tablestyle preferredrowheight. To make a > column readonly set the datagridtextboxcolumn readonly property to true. > > Ken > --------------- > > "scorpion53061" <sc****************************@yahoo.com> wrote in message > news:u7**************@TK2MSFTNGP09.phx.gbl... > > In this code what do I have to do to get the read only and Height property > > to work? > > this is going into a datagrid. > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > > BOOKSLABEL.MappingName = "Label" > > BOOKSLABEL.HeaderText = "Possible Fields" > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > BOOKSLABEL.TextBox.Height = 150 > > BOOKSLABEL.Width = 200 > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > >
Hi,
Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.ReadOnly = True
Ken
------------
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl... HI ken,
In this scenario, Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.TextBox.ReadOnly = True how would you have made this column read only?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:O0****************@TK2MSFTNGP12.phx.gbl... Hi,
Yes.
Ken ------------------------ "scorpion53061" <sc****************************@yahoo.com> wrote in message news:Of*************@TK2MSFTNGP09.phx.gbl... Hi Ken,
Can we set one column to read only? We can set the back colr and such
in the code below for one column...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uK*************@TK2MSFTNGP09.phx.gbl... > Hi, > > To set the row height adjust the tablestyle preferredrowheight. To make a > column readonly set the datagridtextboxcolumn readonly property to true. > > Ken > --------------- > > "scorpion53061" <sc****************************@yahoo.com> wrote in message > news:u7**************@TK2MSFTNGP09.phx.gbl... > > In this code what do I have to do to get the read only and Height property > > to work? > > this is going into a datagrid. > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > > BOOKSLABEL.MappingName = "Label" > > BOOKSLABEL.HeaderText = "Possible Fields" > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > BOOKSLABEL.TextBox.Height = 150 > > BOOKSLABEL.Width = 200 > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > >
I went wrong on the row...when teh user selected the row it would still
allow the user to delete it.
I dealt with that problem and the rest except one.
How if you make the grid cell size 40 for instance, make the text appear in
the middle of the cell aligned left?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:ef**************@TK2MSFTNGP12.phx.gbl... Hi,
Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor =
System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.ReadOnly = True Ken ------------ "scorpion53061" <sc****************************@yahoo.com> wrote in
message news:O2**************@TK2MSFTNGP09.phx.gbl... HI ken,
In this scenario, Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor =
System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.TextBox.ReadOnly = True how would you have made this column read only?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:O0****************@TK2MSFTNGP12.phx.gbl... Hi,
Yes.
Ken ------------------------ "scorpion53061" <sc****************************@yahoo.com> wrote in message news:Of*************@TK2MSFTNGP09.phx.gbl... > Hi Ken, > > Can we set one column to read only? We can set the back colr and
such in the > code below for one column... > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:uK*************@TK2MSFTNGP09.phx.gbl... > > Hi, > > > > To set the row height adjust the tablestyle preferredrowheight.
To make a > > column readonly set the datagridtextboxcolumn readonly property to true. > > > > Ken > > --------------- > > > > "scorpion53061" <sc****************************@yahoo.com> wrote
in > message > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > In this code what do I have to do to get the read only and
Height > property > > > to work? > > > this is going into a datagrid. > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > BOOKSLABEL.TextBox.BackColor = > System.Drawing.SystemColors.Desktop > > > BOOKSLABEL.MappingName = "Label" > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > BOOKSLABEL.TextBox.Height = 150 > > > BOOKSLABEL.Width = 200 > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > >
Hi,
You would have to override the paint event. I posted an example
here. http://www.onteorasoftware.com/Datagrid.aspx#AnsDB2
Ken
----------------
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... I went wrong on the row...when teh user selected the row it would still allow the user to delete it. I dealt with that problem and the rest except one.
How if you make the grid cell size 40 for instance, make the text appear
in the middle of the cell aligned left?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:ef**************@TK2MSFTNGP12.phx.gbl... Hi,
Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.ReadOnly = True
Ken ------------ "scorpion53061" <sc****************************@yahoo.com> wrote in message news:O2**************@TK2MSFTNGP09.phx.gbl... HI ken,
In this scenario, Dim BOOKSLABEL As New ColoredTextBoxColumn BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop BOOKSLABEL.MappingName = "Label" BOOKSLABEL.HeaderText = "Possible Fields" BOOKSLABEL.Alignment = HorizontalAlignment.Left BOOKSLABEL.TextBox.Height = 150 BOOKSLABEL.Width = 200 BOOKSLABEL.TextBox.ReadOnly = True how would you have made this column read only?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:O0****************@TK2MSFTNGP12.phx.gbl... > Hi, > > Yes. > > Ken > ------------------------ > "scorpion53061" <sc****************************@yahoo.com> wrote in message > news:Of*************@TK2MSFTNGP09.phx.gbl... > > Hi Ken, > > > > Can we set one column to read only? We can set the back colr and such in > the > > code below for one column... > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > news:uK*************@TK2MSFTNGP09.phx.gbl... > > > Hi, > > > > > > To set the row height adjust the tablestyle preferredrowheight. To make > a > > > column readonly set the datagridtextboxcolumn readonly property
to true. > > > > > > Ken > > > --------------- > > > > > > "scorpion53061" <sc****************************@yahoo.com> wrote in > > message > > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > > In this code what do I have to do to get the read only and Height > > property > > > > to work? > > > > this is going into a datagrid. > > > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > > BOOKSLABEL.TextBox.BackColor = > > System.Drawing.SystemColors.Desktop > > > > BOOKSLABEL.MappingName = "Label" > > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > > BOOKSLABEL.TextBox.Height = 150 > > > > BOOKSLABEL.Width = 200 > > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > > > > > > > > > >
Were you intending for this code to center it vertically in the cell or just
horizontally?
When I used it it always top justified just like mine...
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl... Hi,
You would have to override the paint event. I posted an
example here. http://www.onteorasoftware.com/Datagrid.aspx#AnsDB2
Ken ---------------- "scorpion53061" <sc****************************@yahoo.com> wrote in
message news:%2***************@TK2MSFTNGP10.phx.gbl... I went wrong on the row...when teh user selected the row it would still allow the user to delete it. I dealt with that problem and the rest except one.
How if you make the grid cell size 40 for instance, make the text appear in the middle of the cell aligned left?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:ef**************@TK2MSFTNGP12.phx.gbl... Hi,
Dim BOOKSLABEL As New ColoredTextBoxColumn > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > BOOKSLABEL.MappingName = "Label" > BOOKSLABEL.HeaderText = "Possible Fields" > BOOKSLABEL.Alignment = HorizontalAlignment.Left > BOOKSLABEL.TextBox.Height = 150 > BOOKSLABEL.Width = 200 > BOOKSLABEL.ReadOnly = True
Ken ------------ "scorpion53061" <sc****************************@yahoo.com> wrote in message news:O2**************@TK2MSFTNGP09.phx.gbl... > HI ken, > > In this scenario, > Dim BOOKSLABEL As New ColoredTextBoxColumn > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > BOOKSLABEL.MappingName = "Label" > BOOKSLABEL.HeaderText = "Possible Fields" > BOOKSLABEL.Alignment = HorizontalAlignment.Left > BOOKSLABEL.TextBox.Height = 150 > BOOKSLABEL.Width = 200 > BOOKSLABEL.TextBox.ReadOnly = True > how would you have made this column read only? > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:O0****************@TK2MSFTNGP12.phx.gbl... > > Hi, > > > > Yes. > > > > Ken > > ------------------------ > > "scorpion53061" <sc****************************@yahoo.com> wrote
in > message > > news:Of*************@TK2MSFTNGP09.phx.gbl... > > > Hi Ken, > > > > > > Can we set one column to read only? We can set the back colr and such in > > the > > > code below for one column... > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > news:uK*************@TK2MSFTNGP09.phx.gbl... > > > > Hi, > > > > > > > > To set the row height adjust the tablestyle
preferredrowheight. To > make > > a > > > > column readonly set the datagridtextboxcolumn readonly
property to > true. > > > > > > > > Ken > > > > --------------- > > > > > > > > "scorpion53061" <sc****************************@yahoo.com>
wrote in > > > message > > > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > > > In this code what do I have to do to get the read only and Height > > > property > > > > > to work? > > > > > this is going into a datagrid. > > > > > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > > > BOOKSLABEL.TextBox.BackColor = > > > System.Drawing.SystemColors.Desktop > > > > > BOOKSLABEL.MappingName = "Label" > > > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > > > BOOKSLABEL.TextBox.Height = 150 > > > > > BOOKSLABEL.Width = 200 > > > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Ken,
This code sample (I didnt get the vertical alignment working) but using an
Arraylist for the grid is very cool. Thank you for the sample.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uV**************@TK2MSFTNGP12.phx.gbl... Hi,
You would have to override the paint event. I posted an
example here. http://www.onteorasoftware.com/Datagrid.aspx#AnsDB2
Ken ---------------- "scorpion53061" <sc****************************@yahoo.com> wrote in
message news:%2***************@TK2MSFTNGP10.phx.gbl... I went wrong on the row...when teh user selected the row it would still allow the user to delete it. I dealt with that problem and the rest except one.
How if you make the grid cell size 40 for instance, make the text appear in the middle of the cell aligned left?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:ef**************@TK2MSFTNGP12.phx.gbl... Hi,
Dim BOOKSLABEL As New ColoredTextBoxColumn > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > BOOKSLABEL.MappingName = "Label" > BOOKSLABEL.HeaderText = "Possible Fields" > BOOKSLABEL.Alignment = HorizontalAlignment.Left > BOOKSLABEL.TextBox.Height = 150 > BOOKSLABEL.Width = 200 > BOOKSLABEL.ReadOnly = True
Ken ------------ "scorpion53061" <sc****************************@yahoo.com> wrote in message news:O2**************@TK2MSFTNGP09.phx.gbl... > HI ken, > > In this scenario, > Dim BOOKSLABEL As New ColoredTextBoxColumn > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > BOOKSLABEL.MappingName = "Label" > BOOKSLABEL.HeaderText = "Possible Fields" > BOOKSLABEL.Alignment = HorizontalAlignment.Left > BOOKSLABEL.TextBox.Height = 150 > BOOKSLABEL.Width = 200 > BOOKSLABEL.TextBox.ReadOnly = True > how would you have made this column read only? > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:O0****************@TK2MSFTNGP12.phx.gbl... > > Hi, > > > > Yes. > > > > Ken > > ------------------------ > > "scorpion53061" <sc****************************@yahoo.com> wrote
in > message > > news:Of*************@TK2MSFTNGP09.phx.gbl... > > > Hi Ken, > > > > > > Can we set one column to read only? We can set the back colr and such in > > the > > > code below for one column... > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > news:uK*************@TK2MSFTNGP09.phx.gbl... > > > > Hi, > > > > > > > > To set the row height adjust the tablestyle
preferredrowheight. To > make > > a > > > > column readonly set the datagridtextboxcolumn readonly
property to > true. > > > > > > > > Ken > > > > --------------- > > > > > > > > "scorpion53061" <sc****************************@yahoo.com>
wrote in > > > message > > > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > > > In this code what do I have to do to get the read only and Height > > > property > > > > > to work? > > > > > this is going into a datagrid. > > > > > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > > > BOOKSLABEL.TextBox.BackColor = > > > System.Drawing.SystemColors.Desktop > > > > > BOOKSLABEL.MappingName = "Label" > > > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > > > BOOKSLABEL.TextBox.Height = 150 > > > > > BOOKSLABEL.Width = 200 > > > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Hi,
Look at the stringformat linealignment property.
Ken
---------------------------
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:uw**************@TK2MSFTNGP12.phx.gbl... Ken,
This code sample (I didnt get the vertical alignment working) but using an Arraylist for the grid is very cool. Thank you for the sample.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi,
You would have to override the paint event. I posted an example here. http://www.onteorasoftware.com/Datagrid.aspx#AnsDB2
Ken ---------------- "scorpion53061" <sc****************************@yahoo.com> wrote in message news:%2***************@TK2MSFTNGP10.phx.gbl... I went wrong on the row...when teh user selected the row it would
still allow the user to delete it. I dealt with that problem and the rest except one.
How if you make the grid cell size 40 for instance, make the text
appear in the middle of the cell aligned left?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:ef**************@TK2MSFTNGP12.phx.gbl... > Hi, > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > > BOOKSLABEL.MappingName = "Label" > > BOOKSLABEL.HeaderText = "Possible Fields" > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > BOOKSLABEL.TextBox.Height = 150 > > BOOKSLABEL.Width = 200 > > BOOKSLABEL.ReadOnly = True > > Ken > ------------ > "scorpion53061" <sc****************************@yahoo.com> wrote in message > news:O2**************@TK2MSFTNGP09.phx.gbl... > > HI ken, > > > > In this scenario, > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > BOOKSLABEL.TextBox.BackColor = System.Drawing.SystemColors.Desktop > > BOOKSLABEL.MappingName = "Label" > > BOOKSLABEL.HeaderText = "Possible Fields" > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > BOOKSLABEL.TextBox.Height = 150 > > BOOKSLABEL.Width = 200 > > BOOKSLABEL.TextBox.ReadOnly = True > > how would you have made this column read only? > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > news:O0****************@TK2MSFTNGP12.phx.gbl... > > > Hi, > > > > > > Yes. > > > > > > Ken > > > ------------------------ > > > "scorpion53061" <sc****************************@yahoo.com> wrote in > > message > > > news:Of*************@TK2MSFTNGP09.phx.gbl... > > > > Hi Ken, > > > > > > > > Can we set one column to read only? We can set the back colr
and such > in > > > the > > > > code below for one column... > > > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > > news:uK*************@TK2MSFTNGP09.phx.gbl... > > > > > Hi, > > > > > > > > > > To set the row height adjust the tablestyle
preferredrowheight. To > > make > > > a > > > > > column readonly set the datagridtextboxcolumn readonly property to > > true. > > > > > > > > > > Ken > > > > > --------------- > > > > > > > > > > "scorpion53061" <sc****************************@yahoo.com> wrote in > > > > message > > > > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > > > > In this code what do I have to do to get the read only and Height > > > > property > > > > > > to work? > > > > > > this is going into a datagrid. > > > > > > > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > > > > BOOKSLABEL.TextBox.BackColor = > > > > System.Drawing.SystemColors.Desktop > > > > > > BOOKSLABEL.MappingName = "Label" > > > > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > > > > BOOKSLABEL.TextBox.Height = 150 > > > > > > BOOKSLABEL.Width = 200 > > > > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Problem solved and thank you Ken. It now is vertically aligned with scroll
bars and word wrap.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl... Hi,
Look at the stringformat linealignment property.
Ken --------------------------- "scorpion53061" <sc****************************@yahoo.com> wrote in
message news:uw**************@TK2MSFTNGP12.phx.gbl... Ken,
This code sample (I didnt get the vertical alignment working) but using
an Arraylist for the grid is very cool. Thank you for the sample.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi,
You would have to override the paint event. I posted an example here. http://www.onteorasoftware.com/Datagrid.aspx#AnsDB2
Ken ---------------- "scorpion53061" <sc****************************@yahoo.com> wrote in message news:%2***************@TK2MSFTNGP10.phx.gbl... > I went wrong on the row...when teh user selected the row it would still > allow the user to delete it. > I dealt with that problem and the rest except one. > > How if you make the grid cell size 40 for instance, make the text appear in > the middle of the cell aligned left? > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:ef**************@TK2MSFTNGP12.phx.gbl... > > Hi, > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > BOOKSLABEL.TextBox.BackColor = > System.Drawing.SystemColors.Desktop > > > BOOKSLABEL.MappingName = "Label" > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > BOOKSLABEL.TextBox.Height = 150 > > > BOOKSLABEL.Width = 200 > > > BOOKSLABEL.ReadOnly = True > > > > Ken > > ------------ > > "scorpion53061" <sc****************************@yahoo.com> wrote
in > message > > news:O2**************@TK2MSFTNGP09.phx.gbl... > > > HI ken, > > > > > > In this scenario, > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > BOOKSLABEL.TextBox.BackColor = > System.Drawing.SystemColors.Desktop > > > BOOKSLABEL.MappingName = "Label" > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > BOOKSLABEL.TextBox.Height = 150 > > > BOOKSLABEL.Width = 200 > > > BOOKSLABEL.TextBox.ReadOnly = True > > > how would you have made this column read only? > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > news:O0****************@TK2MSFTNGP12.phx.gbl... > > > > Hi, > > > > > > > > Yes. > > > > > > > > Ken > > > > ------------------------ > > > > "scorpion53061" <sc****************************@yahoo.com>
wrote in > > > message > > > > news:Of*************@TK2MSFTNGP09.phx.gbl... > > > > > Hi Ken, > > > > > > > > > > Can we set one column to read only? We can set the back colr and > such > > in > > > > the > > > > > code below for one column... > > > > > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > > > news:uK*************@TK2MSFTNGP09.phx.gbl... > > > > > > Hi, > > > > > > > > > > > > To set the row height adjust the tablestyle preferredrowheight. > To > > > make > > > > a > > > > > > column readonly set the datagridtextboxcolumn readonly property to > > > true. > > > > > > > > > > > > Ken > > > > > > --------------- > > > > > > > > > > > > "scorpion53061" <sc****************************@yahoo.com> wrote > in > > > > > message > > > > > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > > > > > In this code what do I have to do to get the read only
and > Height > > > > > property > > > > > > > to work? > > > > > > > this is going into a datagrid. > > > > > > > > > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > > > > > BOOKSLABEL.TextBox.BackColor = > > > > > System.Drawing.SystemColors.Desktop > > > > > > > BOOKSLABEL.MappingName = "Label" > > > > > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > > > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > > > > > BOOKSLABEL.TextBox.Height = 150 > > > > > > > BOOKSLABEL.Width = 200 > > > > > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Ken,
One more thought on this line.......
Do you know of a link or sample in the SDK that would let me depending on
the value of column 1 of the datagrid would put a combo box in the grid for
the second column? If hte value didnt equal what I was looking for then it
would not do this and leave it as a textbox?
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl... Hi,
Look at the stringformat linealignment property.
Ken --------------------------- "scorpion53061" <sc****************************@yahoo.com> wrote in
message news:uw**************@TK2MSFTNGP12.phx.gbl... Ken,
This code sample (I didnt get the vertical alignment working) but using
an Arraylist for the grid is very cool. Thank you for the sample.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi,
You would have to override the paint event. I posted an example here. http://www.onteorasoftware.com/Datagrid.aspx#AnsDB2
Ken ---------------- "scorpion53061" <sc****************************@yahoo.com> wrote in message news:%2***************@TK2MSFTNGP10.phx.gbl... > I went wrong on the row...when teh user selected the row it would still > allow the user to delete it. > I dealt with that problem and the rest except one. > > How if you make the grid cell size 40 for instance, make the text appear in > the middle of the cell aligned left? > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:ef**************@TK2MSFTNGP12.phx.gbl... > > Hi, > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > BOOKSLABEL.TextBox.BackColor = > System.Drawing.SystemColors.Desktop > > > BOOKSLABEL.MappingName = "Label" > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > BOOKSLABEL.TextBox.Height = 150 > > > BOOKSLABEL.Width = 200 > > > BOOKSLABEL.ReadOnly = True > > > > Ken > > ------------ > > "scorpion53061" <sc****************************@yahoo.com> wrote
in > message > > news:O2**************@TK2MSFTNGP09.phx.gbl... > > > HI ken, > > > > > > In this scenario, > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > BOOKSLABEL.TextBox.BackColor = > System.Drawing.SystemColors.Desktop > > > BOOKSLABEL.MappingName = "Label" > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > BOOKSLABEL.TextBox.Height = 150 > > > BOOKSLABEL.Width = 200 > > > BOOKSLABEL.TextBox.ReadOnly = True > > > how would you have made this column read only? > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > news:O0****************@TK2MSFTNGP12.phx.gbl... > > > > Hi, > > > > > > > > Yes. > > > > > > > > Ken > > > > ------------------------ > > > > "scorpion53061" <sc****************************@yahoo.com>
wrote in > > > message > > > > news:Of*************@TK2MSFTNGP09.phx.gbl... > > > > > Hi Ken, > > > > > > > > > > Can we set one column to read only? We can set the back colr and > such > > in > > > > the > > > > > code below for one column... > > > > > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > > > news:uK*************@TK2MSFTNGP09.phx.gbl... > > > > > > Hi, > > > > > > > > > > > > To set the row height adjust the tablestyle preferredrowheight. > To > > > make > > > > a > > > > > > column readonly set the datagridtextboxcolumn readonly property to > > > true. > > > > > > > > > > > > Ken > > > > > > --------------- > > > > > > > > > > > > "scorpion53061" <sc****************************@yahoo.com> wrote > in > > > > > message > > > > > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > > > > > In this code what do I have to do to get the read only
and > Height > > > > > property > > > > > > > to work? > > > > > > > this is going into a datagrid. > > > > > > > > > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > > > > > BOOKSLABEL.TextBox.BackColor = > > > > > System.Drawing.SystemColors.Desktop > > > > > > > BOOKSLABEL.MappingName = "Label" > > > > > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > > > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > > > > > BOOKSLABEL.TextBox.Height = 150 > > > > > > > BOOKSLABEL.Width = 200 > > > > > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
This worked but........
Dim C As New ComboBox
C.Location =
DataGridSH.PointToClient(DataGridSH.MousePosition)
C.Items.Add("foobar")
C.Items.Add("hello world")
DataGridSH.Controls.Add(C)
C.BringToFront()
but if you came back to it it added it again and I couldnt get it to replace
the textbox currently in the grid.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl... Hi,
Look at the stringformat linealignment property.
Ken --------------------------- "scorpion53061" <sc****************************@yahoo.com> wrote in
message news:uw**************@TK2MSFTNGP12.phx.gbl... Ken,
This code sample (I didnt get the vertical alignment working) but using
an Arraylist for the grid is very cool. Thank you for the sample.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:uV**************@TK2MSFTNGP12.phx.gbl... Hi,
You would have to override the paint event. I posted an example here. http://www.onteorasoftware.com/Datagrid.aspx#AnsDB2
Ken ---------------- "scorpion53061" <sc****************************@yahoo.com> wrote in message news:%2***************@TK2MSFTNGP10.phx.gbl... > I went wrong on the row...when teh user selected the row it would still > allow the user to delete it. > I dealt with that problem and the rest except one. > > How if you make the grid cell size 40 for instance, make the text appear in > the middle of the cell aligned left? > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:ef**************@TK2MSFTNGP12.phx.gbl... > > Hi, > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > BOOKSLABEL.TextBox.BackColor = > System.Drawing.SystemColors.Desktop > > > BOOKSLABEL.MappingName = "Label" > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > BOOKSLABEL.TextBox.Height = 150 > > > BOOKSLABEL.Width = 200 > > > BOOKSLABEL.ReadOnly = True > > > > Ken > > ------------ > > "scorpion53061" <sc****************************@yahoo.com> wrote
in > message > > news:O2**************@TK2MSFTNGP09.phx.gbl... > > > HI ken, > > > > > > In this scenario, > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > BOOKSLABEL.TextBox.BackColor = > System.Drawing.SystemColors.Desktop > > > BOOKSLABEL.MappingName = "Label" > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > BOOKSLABEL.TextBox.Height = 150 > > > BOOKSLABEL.Width = 200 > > > BOOKSLABEL.TextBox.ReadOnly = True > > > how would you have made this column read only? > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > news:O0****************@TK2MSFTNGP12.phx.gbl... > > > > Hi, > > > > > > > > Yes. > > > > > > > > Ken > > > > ------------------------ > > > > "scorpion53061" <sc****************************@yahoo.com>
wrote in > > > message > > > > news:Of*************@TK2MSFTNGP09.phx.gbl... > > > > > Hi Ken, > > > > > > > > > > Can we set one column to read only? We can set the back colr and > such > > in > > > > the > > > > > code below for one column... > > > > > > > > > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > > > > > news:uK*************@TK2MSFTNGP09.phx.gbl... > > > > > > Hi, > > > > > > > > > > > > To set the row height adjust the tablestyle preferredrowheight. > To > > > make > > > > a > > > > > > column readonly set the datagridtextboxcolumn readonly property to > > > true. > > > > > > > > > > > > Ken > > > > > > --------------- > > > > > > > > > > > > "scorpion53061" <sc****************************@yahoo.com> wrote > in > > > > > message > > > > > > news:u7**************@TK2MSFTNGP09.phx.gbl... > > > > > > > In this code what do I have to do to get the read only
and > Height > > > > > property > > > > > > > to work? > > > > > > > this is going into a datagrid. > > > > > > > > > > > > > > Dim BOOKSLABEL As New ColoredTextBoxColumn > > > > > > > BOOKSLABEL.TextBox.BackColor = > > > > > System.Drawing.SystemColors.Desktop > > > > > > > BOOKSLABEL.MappingName = "Label" > > > > > > > BOOKSLABEL.HeaderText = "Possible Fields" > > > > > > > BOOKSLABEL.Alignment = HorizontalAlignment.Left > > > > > > > BOOKSLABEL.TextBox.Height = 150 > > > > > > > BOOKSLABEL.Width = 200 > > > > > > > BOOKSLABEL.TextBox.ReadOnly = True > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
by: Rick |
last post by:
Hello all, I hope all is well with you.
I am having a seriously difficult time with this problem. Allow me to
set
up the problem.
I have a System.Web.UI.Page with the following controls...
|
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...
|
by: tshad |
last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is
filled?
I have a bunch of DataGrids that get displayed nested inside a DataList.
The datagrid looks like:
...
|
by: tshad |
last post by:
I am having trouble with links in my DataGrid.
I have Links all over my page set to smaller and they are consistant all
over the page in both Mozilla and IE, except for the DataGrid.
Here is a...
|
by: optimizeit |
last post by:
What I am attempting to do is import an Excel Workbook and display the
worksheets in a datagrid dynamically.
I am very close to getting this to work. I have to this point
successfully imported a...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |