Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
QuestionHow to convert Template field into LinkButton Pin
gunaarun17-Apr-08 21:51
gunaarun17-Apr-08 21:51 
AnswerRe: How to convert Template field into LinkButton Pin
Christian Graus17-Apr-08 21:56
protectorChristian Graus17-Apr-08 21:56 
AnswerRe: How to convert Template field into LinkButton Pin
Member 401784318-Apr-08 3:22
Member 401784318-Apr-08 3:22 
Questionwhy wrong radioButton method is invoched= Pin
merh17-Apr-08 21:35
merh17-Apr-08 21:35 
GeneralRe: why wrong radioButton method is invoched= Pin
Christian Graus17-Apr-08 21:49
protectorChristian Graus17-Apr-08 21:49 
GeneralRe: why wrong radioButton method is invoched= Pin
merh17-Apr-08 22:55
merh17-Apr-08 22:55 
GeneralAutosize columns in a ListView Pin
anderslundsgard17-Apr-08 21:27
anderslundsgard17-Apr-08 21:27 
GeneralRe: Autosize columns in a ListView Pin
John_Adams17-Apr-08 22:44
John_Adams17-Apr-08 22:44 
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 Smile | :) .

Regards,
John Adams
ComponentOne LLC

GeneralRe: Autosize columns in a ListView Pin
mav.northwind17-Apr-08 22:44
mav.northwind17-Apr-08 22:44 
GeneralRename Excel sheets after exporting to a new Excel spreadsheet Pin
Walaza17-Apr-08 21:26
Walaza17-Apr-08 21:26 
GeneralRe: Rename Excel sheets after exporting to a new Excel spreadsheet [modified] Pin
cocoonwls18-Apr-08 3:13
cocoonwls18-Apr-08 3:13 
GeneralRe: Rename Excel sheets after exporting to a new Excel spreadsheet Pin
Walaza18-Apr-08 4:05
Walaza18-Apr-08 4:05 
QuestionHow to Convert Template Field into LinkButton Pin
gunaarun17-Apr-08 21:19
gunaarun17-Apr-08 21:19 
AnswerRe: How to Convert Template Field into LinkButton Pin
Christian Graus17-Apr-08 21:50
protectorChristian Graus17-Apr-08 21:50 
QuestionHow to convert the Template Field into LinkButton Pin
gunaarun17-Apr-08 21:13
gunaarun17-Apr-08 21:13 
GeneralReading XML which has colon in Element Pin
satsumatable17-Apr-08 20:43
satsumatable17-Apr-08 20:43 
GeneralRe: Reading XML which has colon in Element Pin
Christian Graus17-Apr-08 20:50
protectorChristian Graus17-Apr-08 20:50 
Questionhow can i create an twinkle effect on windows start bar as msn does when a message get Pin
greekius17-Apr-08 20:28
greekius17-Apr-08 20:28 
AnswerRe: how can i create an twinkle effect on windows start bar as msn does when a message get Pin
Ajay.k_Singh17-Apr-08 23:05
Ajay.k_Singh17-Apr-08 23:05 
Generalnormalize int data Pin
George_George17-Apr-08 20:28
George_George17-Apr-08 20:28 
GeneralRe: normalize int data Pin
Christian Graus17-Apr-08 20:33
protectorChristian Graus17-Apr-08 20:33 
GeneralRe: normalize int data Pin
George_George17-Apr-08 21:35
George_George17-Apr-08 21:35 
GeneralRe: normalize int data [modified] Pin
Luc Pattyn17-Apr-08 21:08
sitebuilderLuc Pattyn17-Apr-08 21:08 
GeneralRe: normalize int data Pin
George_George17-Apr-08 21:15
George_George17-Apr-08 21:15 
GeneralRe: normalize int data Pin
George_George17-Apr-08 23:28
George_George17-Apr-08 23:28 

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.