Click here to Skip to main content
15,902,836 members
Home / Discussions / C#
   

C#

 
GeneralRe: Finding currently logged on user Pin
conor2015-Nov-07 4:55
conor2015-Nov-07 4:55 
GeneralRe: Finding currently logged on user Pin
conor2016-Nov-07 0:32
conor2016-Nov-07 0:32 
QuestionExport File Pin
MumbleB13-Nov-07 2:44
MumbleB13-Nov-07 2:44 
AnswerRe: Export File Pin
duncanmhor13-Nov-07 2:56
duncanmhor13-Nov-07 2:56 
AnswerRe: Export File Pin
SVb.net13-Nov-07 5:51
SVb.net13-Nov-07 5:51 
QuestionHow to control forecolor of a disabled label Pin
baelzaden13-Nov-07 1:39
baelzaden13-Nov-07 1:39 
Questionfile rename application Pin
Sunil Wise13-Nov-07 1:18
professionalSunil Wise13-Nov-07 1:18 
Questionadd column to datagridview Pin
arkiboys13-Nov-07 1:15
arkiboys13-Nov-07 1:15 
Hi,
On clicking a search button, a datagridview is populated with data.
Each row has an extra column to display a button in it. This is the details button for each row.
The problem is that when I click on the search button to reload the datagridview, a new details column gets added to the first column of datagridview.
How is it possible to prevent adding extra column to the datagridview each time I click the search button?

Please note, I only get the details column as the last column, the first time the datagridview is loaded.

This is how I am adding the details column dynamically to the datagridview.
I think it is to do with the line which has new in it...

dsPricesSourcesBest = Business.clsSecurities.PricesSourcesBestGet(intCountryID, intSectorID, intSecurityID);

defaultView = dsPricesSourcesBest.Tables["PricesSourcesBest"].DefaultView;
dtPricesSourcesBest = dsPricesSourcesBest.Tables["PricesSourcesBest"];


dgvSecurityPricing.DataSource = null;

dgvSecurityPricing.DataSource = defaultView;

dgvSecurityPricing.ReadOnly = true;

//get the count of the records...
lblCount.Text = "Total Records : " + defaultView.Count.ToString();

//Not sure if the problem is being caused because of this line????

DataGridViewButtonColumn detailsCol = new DataGridViewButtonColumn();
detailsCol.Name = "Details";
detailsCol.Text = "Details...";

detailsCol.UseColumnTextForButtonValue = true;

dgvSecurityPricing.Columns.Insert(dgvSecurityPricing.Columns.Count, detailsCol);

dgvSecurityPricing.AllowUserToAddRows = false;
AnswerRe: add column to datagridview Pin
arkiboys13-Nov-07 2:40
arkiboys13-Nov-07 2:40 
QuestionDynamically Binding Data to a Label Pin
sindhutiwari13-Nov-07 1:14
sindhutiwari13-Nov-07 1:14 
QuestionAddPrinterConnection failing to add network printer Pin
ekynox13-Nov-07 0:52
ekynox13-Nov-07 0:52 
AnswerRe: AddPrinterConnection failing to add network printer Pin
ekynox15-Nov-07 9:44
ekynox15-Nov-07 9:44 
QuestionDynamic controls in web Pin
M. J. Jaya Chitra13-Nov-07 0:45
M. J. Jaya Chitra13-Nov-07 0:45 
Questionvs2005, I need to connect data source using c# Pin
kkooring13-Nov-07 0:28
kkooring13-Nov-07 0:28 
QuestionXMLDocument.GetElementsByTagName returns comments ! Pin
N a v a n e e t h13-Nov-07 0:16
N a v a n e e t h13-Nov-07 0:16 
AnswerRe: XMLDocument.GetElementsByTagName returns comments ! Pin
Sun Rays13-Nov-07 0:27
Sun Rays13-Nov-07 0:27 
QuestionDoes C# provide all the functionalities of WinPcap? Pin
Diana Fernandez12-Nov-07 23:37
Diana Fernandez12-Nov-07 23:37 
QuestionSetting Print Job Parameters Pin
edgar_raj12-Nov-07 23:33
edgar_raj12-Nov-07 23:33 
AnswerRe: Setting Print Job Parameters Pin
Vasudevan Deepak Kumar13-Nov-07 20:34
Vasudevan Deepak Kumar13-Nov-07 20:34 
QuestionCustom Control in C# Pin
Abhijit Jana12-Nov-07 22:52
professionalAbhijit Jana12-Nov-07 22:52 
Questionpassword assgning application? Pin
shaz jazz12-Nov-07 22:20
shaz jazz12-Nov-07 22:20 
AnswerRe: password assgning application? Pin
Christian Graus12-Nov-07 22:31
protectorChristian Graus12-Nov-07 22:31 
AnswerRe: password assgning application? Pin
Sun Rays12-Nov-07 22:33
Sun Rays12-Nov-07 22:33 
GeneralRe: password assgning application? Pin
shaz jazz13-Nov-07 2:32
shaz jazz13-Nov-07 2:32 
GeneralRe: password assgning application? Pin
shaz jazz22-Nov-07 11:42
shaz jazz22-Nov-07 11:42 

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.