|
The currentCell.Value was null because it was not persisting the value.
After digging into things I was going to write my own control that would guarantee the state is maintained. Then when I went to see what existed for Notes to Inheriters I found code that showed what I had to do.
It turns out that I cannot check the state of the checkbox with only a single event. I have to do it in two events.
First binding to the datagridview.CurrentCellDirtyStateChanged and force the control to persist the data with cell.CommitEdit. That indirectly forces the datagridview.CellValueChanged event which now allows me to investigate the cell state value.
I now have everything working as expected !!!
|
|
|
|
|
Hi.
Does anybody know if it is possible to write programatically a text in a web application page with functionnalities like "newline", "tab", "center text",...
In fact: organise a text programatically before putting it in a web page.
Thanks,
Oren
|
|
|
|
|
You can write text and format it with normal html controls. Then u can add this to one of the block-level element( , etc).
Example:
1. Type the following script in notepad and save it in wwwroot folder with name such as "Test1.aspx"
2. Open Internet Explorer and the type URL: http://localhost/Test1.aspx
<script runat="server">
Sub Page_Load(sender As Object,e As EventArgs)
Dim str As String="<h1><center> Welcome To Web<b/> Appplication </center></h1> in <br /> <h3>ASP.NET</h3>"
div1.InnerHtml=str
End Sub
</script>
<html>
<head>
</head>
<body>
A Simple Test<br />
<form runat="server">
<p id="div1" runat="server" />
</form>
</body>
</html>
I dont know wheather may reply solve ur problem. However i just tried.
|
|
|
|
|
You can write text and format it with normal html controls. Then u can add this to one of the block-level element( , etc).
Example:
1. Type the following script in notepad and save it in wwwroot folder with name such as "Test1.aspx"
2. Open Internet Explorer and the type URL: http://localhost/Test1.aspx
<script runat="server">
Sub Page_Load(sender As Object,e As EventArgs)
Dim str As String="<pre><h1><center> Welcome To Web<b/> Appplication </center></h1> in <br /> <h3>ASP.NET</h3> "
div1.InnerHtml=str
End Sub
A Simple Test
|
|
|
|
|
You can write text and format it with normal html controls. Then u can add this to one of the block-level element( , etc).
Example:
1. Type the following script in notepad and save it in wwwroot folder with name such as "Test1.aspx"
2. Open Internet Explorer and the type URL: http://localhost/Test1.aspx
<script runat="server">
Sub Page_Load(sender As Object,e As EventArgs)
Dim str As String=<pre>"<h1><center> Welcome To Web<b/> Appplication </center></h1> in <br /> <h3>ASP.NET</h3>"
div1.InnerHtml=str
End Sub
A Simple Test
|
|
|
|
|
sorry for inconvience. The browser is parsing data section. The contents of str varaible are as under:
<h1><center> Welcome To Web<b/> Appplication </center></h1> in <br /> <h3>ASP.NET</h3>
|
|
|
|
|
You can use StringBuilder to build text before dumping on a label, literal or straight Response.Write() . Or you can look at HtmlTextWriter which has some specific methods for HTML writing (obviously), though it doesn't facilitate newline or tab.
-- modified at 10:47 Friday 28th July, 2006
I take that back, HtmlTextWriter does handle indent and newline.
|
|
|
|
|
Thanks guys, I'll try what you proposed tomorow (on sunday) when I'll be back at my project computer. Here, I don't have Visual.
Oren,
|
|
|
|
|
|
Take a look at the NotifyIcon class.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
This might help you out.
http://msdn.microsoft.com/coding4fun/inthebox/systrayalclock/default.aspx
-K
|
|
|
|
|
I have an fixed length array :-
Byte[] myArray = new Byte[50];
Now this represents a specific message structure. For example, the sort of thing I want to do is :
1. to read and set a bit field, Byte[25], bit 1
2. to read and set a 5 bit value, Byte[20], bits 0-5
3. to read and set a 32 bit number, Byte[10]
These are just a few examples of what functions I want to perform on the array. But they highlight some of my challanges.
Any thoughts on gneral ways to achieve this?
Thanks,
Liam
|
|
|
|
|
Well, to set a particular bit in a byte, I would use bitwise operators. The exclusive-or (^) would work:
byte b = 35;
b ^= 0x01;
*Note - This will change the value of the bit. If it's 0, it will be changed to 1, if it's 1 it will be changed to zero.
Of course, it's hard to tell what you mean by bit 1. But to set a particular bit in the byte array is not much different:
byte[] b = new byte[50];
...
b[25] ^= 0x01;
To read the value, you can use a bitwise-and ( & ) :
if (b[20] & 0x1f == a) { ... }
I'm not sure what you mean by setting a 32 bit number on a single byte though.
Logifusion[^]Last modified: Friday, July 28, 2006 9:43:29 AM --
|
|
|
|
|
forgive me - I'm new to c#
public struct lookupOjbect
{
string fieldvalue;
public lookupOjbect (string fieldvalue)
{
this.fieldvalue = fieldvalue;
}
}
lookupOjbect lookupObjectRow = new lookupOjbect();
When I want to assign a value to this object then 'fieldvalue' doesnt show with intellisense. e.g. lookupObjectRow.fieldvalue - doesnt show!
|
|
|
|
|
it is because fieldvalue is private.
Try
public string fieldvalue
though that is not great oop, and most thing use properties to get around that and keep encapulation, e.g.
private string fieldvalue;
public string FieldValue
{
set { this.fieldvalue = value; }
get { return this.fieldvalue; }
}
|
|
|
|
|
|
Remember that changing the values in a struct type only affect that particular instance as it is a value type.
If you are planning on implementing a Get / Set accessor, you may want to think about using a class instead.
|
|
|
|
|
The Catalyst wrote: Remember that changing the values in a struct type only affect that particular instance as it is a value type.
And so what happens in a class if it doesn't "only affect that particular instance"?
The Catalyst wrote: If you are planning on implementing a Get / Set accessor, you may want to think about using a class instead
Why would a class be better in this instance? What is wrong with putting Get/Set accessors on a struct?
|
|
|
|
|
Colin Angus Mackay wrote: And so what happens in a class if it doesn't "only affect that particular instance"?
It's the old Refference / Value type behavior. I think i worded it badly.
Any change made to a class is reflected through all refferences, making changes to a struct only changes the one you are changing in the local context. (Barring special circumstances)
Colin Angus Mackay wrote: Why would a class be better in this instance? What is wrong with putting Get/Set accessors on a struct?
I've never seen a Get / Set in a struct, at least, not in the standard CLR libraries. Tho i suppose there must be some, i can't imagine a use for them; All the com interop structs use public fields.
From what i've seen, everything gets set in the ctor. and accessed through read only properties.
|
|
|
|
|
The Catalyst wrote: I've never seen a Get / Set in a struct, at least, not in the standard CLR libraries.
Actually, virtually every struct I've seen in the BCL uses properties: Point, Size, Rectangle, to name a few, all expose their data via properties.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
True, but they are all read only. None of them implement a set method, you have to create a new object if you want to use different values.
|
|
|
|
|
The Catalyst wrote: True, but they are all read only. None of them implement a set method
That's wrong. Look at the Point.X for example. You can set it.
|
|
|
|
|
Still, pretty pointless.
|
|
|
|
|
The Catalyst wrote: True, but they are all read only.
Have a look at Rectangle.Width, Height, Size, and others.
|
|
|
|
|
The default accessor property for a field in C# is private, therefore it would only be accessible internaly, and not appear on intellisense. Just wack public infront of it.
|
|
|
|