|
The event is called 'checkedchanged', it's working as advertised. When radio1 unchecks, the check has changed, so the event is called. The object passed into the method is the control that raised the event, so you can use that to check if the control is checked or unchecked ( or when you have one event per control, you can access it directly )
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
I don’t find a way to autosize columns i a ListView depending on its contents…
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi,
In regards to your query I would suggest you to try the following code snippet:
The following code example demonstrates initializing a ListView in detail view and automatically resizing the columns using the AutoResizeColumn method. To run this example, paste this code into a Windows Form and call the InitializeResizingListView method from the form's constructor or Load event handler.
-----------------------------------------------------------------------------------------------------
private ListView resizingListView = new ListView();
private Button button1 = new Button();
private void InitializeResizingListView()
{
// Set location and text for button.
button1.Location = new Point(100, 15);
button1.Text = "Resize";
button1.Click += new EventHandler(button1_Click);
// Set the ListView to details view.
resizingListView.View = View.Details;
//Set size, location and populate the ListView.
resizingListView.Size = new Size(200, 100);
resizingListView.Location = new Point(40, 40);
resizingListView.Columns.Add("HeaderSize");
resizingListView.Columns.Add("ColumnContent");
ListViewItem listItem1 = new ListViewItem("Short");
ListViewItem listItem2 = new ListViewItem("Tiny");
listItem1.SubItems.Add(new ListViewItem.ListViewSubItem(
listItem1, "Something longer"));
listItem2.SubItems.Add(new ListViewItem.ListViewSubItem(
listItem2, "Something even longer"));
resizingListView.Items.Add(listItem1);
resizingListView.Items.Add(listItem2);
// Add the ListView and the Button to the form.
this.Controls.Add(resizingListView);
this.Controls.Add(button1);
}
private void button1_Click(object sender, EventArgs e)
{
resizingListView.AutoResizeColumn(0,
ColumnHeaderAutoResizeStyle.HeaderSize);
resizingListView.AutoResizeColumn(1,
ColumnHeaderAutoResizeStyle.ColumnContent);
}
-----------------------------------------------------------------------------------------------------
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Set the ColumnHeader width to -1 or -2 to get autosize according to heading or content.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I have an application that exports data from a datagrid to an excel spreadsheet. The export works perfectly but I have been struggling to get code that renames the sheets from the default (Sheet1, Sheet2, etc) to the name that I want. Can someone help.
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
|
Hi,
Thanx 4 the reply!! But what is a Spreadsheetgear? Below is the code that I use and it gives me an error:
//create new worksheet
Microsoft.Office.Interop.Excel._Application _appClass = new ApplicationClass();
_appClass.Visible = true;
_appClass.Caption = "Exported ECS Errors";
Microsoft.Office.Interop.Excel.Workbook wbk = _appClass.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
wbk.Worksheets["Sheet1"] = "Mvelo";
Please explain what the Spreadsheetgear is/provide me with a solution to this code.
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
I have Convert the Bound field into Template field.. it becomes like this..
<br />
<asp:templatefield headertext="TotalWithheld" sortexpression="Total_Amount"><br />
<edititemtemplate><br />
<asp:label id="Label1" runat="server" text=""><![CDATA[<%# Eval("TotalWithheld") %>]]>'><br />
<br />
</asp:label><br />
</edititemtemplate><br />
<br />
<itemtemplate><br />
<asp:label id="Label1" runat="server" text=""><![CDATA[<%# Bind("TotalWithheld") %>]]>'><br />
<br />
</asp:label><br />
</itemtemplate><br />
</asp:templatefield><br />
Even I tried the Javascript i didnt get the Link button in the field..
Please Help me..
Thanks in advance..
|
|
|
|
|
You asked twice, AND you asked in the wrong forum. Please ask only once and in the right forum. And, try to explain better, I don't see what you're asking ? What did you try with javascript ? Whatdoes that have to do with a sefver control ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have Convert the Bound field into Template field.. it becomes like this..
<asp:templatefield headertext="TotalWithheld" sortexpression="Total_Amount">
<edititemtemplate>
<asp:label id="Label1" runat="server" text="">]]>'>
<itemtemplate>
<asp:label id="Label1" runat="server" text="">]]>'>
Even I tried the javascript.. the Function didnt Convert to Linkbutton
.
Please help me...
Thanks in Advance...
|
|
|
|
|
Hi,
I'm using following code
<br />
XPathDocument doc = new XPathDocument(XMLFilepath);<br />
XPathNavigator nav = doc.CreateNavigator();<br />
XPathExpression expr; <br />
expr = nav.Compile("/"+root+"/"+name+"/"+ElementName);<br />
XPathNodeIterator iterator = nav.Select(expr);<br />
It is working well except following
<br />
<root><br />
<br />
<wafer> </wafer><br />
</name:device1><br />
</root><br />
<br />
</code><br />
<br />
after few anlysis i found that name:device : does this flaw. What this solution to read such kind of XML files?<br />
<br />
Thanks in advance.
|
|
|
|
|
name:device1 means that name is a namespace. You then have to define the name namespace. Or fix your XML format.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how can i create an twinkle effect on windows start bar as msn does when a message get?
|
|
|
|
|
There is no such direct method available in .Net, this can be done using FlashWindow API function which is available in User32.dll file.
Calling this function will require you to use InteropServices class.
Check following link for a tutorial –
http://www.bobpowell.net/flashbar.htm
I hope this helps.
-Ajay.
-------------------------
www.componentone.com
-------------------------
|
|
|
|
|
Hello everyone,
I have a couple of integers, and I want to find a simple and effective way to normalize them into range [0, 1]. Any ideas and code refer?
thanks in advance,
George
|
|
|
|
|
If you only have two ints, then one is 0 and one is 1, right ?
You need to turn them into floats if you want to normalise in a range that includes decimal points. Then you need to decide what the low and high point of the range are, and do the divide/etc on each one to build your normalised list
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian,
Do you have any pseudo code or tutorials for that idea?
regards,
George
|
|
|
|
|
Hi George,
here is some pseudo-code:
intCollection iCollection=...;
int imin=int.MaxValue;
int imax=int.MinValue;
foreach(int i in iCollection) {
if (i<imin) imin=i;
if (i>imax) imax=i;
}
float fmin=0.0;
float fmax=1.0;
float scale=(fmax-fmin)/(imax-imin);
floatCollection fCollection=...;
foreach (int i in iCollection) {
float f=fmin+(i-imin)*scale;
fCollection.Add(f);
}
}
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
modified on Friday, April 18, 2008 3:37 AM
|
|
|
|
|
Cool, Luc Pattyn!
Clear answer.
regards,
George
|
|
|
|
|
Cool Luc,
I heard there is also a logarithm based normalization approach, do you know how to implement in this way?
regards,
George
|
|
|
|
|
Hi George,
you can perform whatever transformation you want on the input data, then apply the
original code (probably the input then already is floating).
I am not sure what a "logarithm based normalization approach" would be officially,
maybe it is just replace every "int i" by its "float log((float)i)" which of course
only works well for i greater than zero.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks Luc,
You are so smart!
regards,
George
|
|
|
|
|
Provided the collection contains at least two different elements...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
there are a couple of reasons the thing was called pseudo-code, you discovered one of them
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|