Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
AnswerRe: Form Controls Pin
NanaAM20-Sep-05 0:58
NanaAM20-Sep-05 0:58 
AnswerRe: Form Controls Pin
Ashok Dhamija20-Sep-05 3:34
Ashok Dhamija20-Sep-05 3:34 
Question"typeloadexception" What is this? How i solve it? Pin
Campaniço20-Sep-05 0:13
Campaniço20-Sep-05 0:13 
AnswerRe: "typeloadexception" What is this? How i solve it? Pin
S. Senthil Kumar20-Sep-05 2:10
S. Senthil Kumar20-Sep-05 2:10 
Questionhow to hide a column in Data Grid Pin
Rizwan Bashir19-Sep-05 23:30
Rizwan Bashir19-Sep-05 23:30 
AnswerRe: how to hide a column in Data Grid Pin
dabuskol20-Sep-05 0:25
dabuskol20-Sep-05 0:25 
GeneralRe: how to hide a column in Data Grid Pin
Rizwan Bashir20-Sep-05 2:34
Rizwan Bashir20-Sep-05 2:34 
GeneralRe: how to hide a column in Data Grid Pin
miah alom20-Sep-05 4:07
miah alom20-Sep-05 4:07 
There are two ways to do it.

(1) Create custom table style. And dont add DataGridTextBoxColumn for the columns you dont want to display.

http://www.codeproject.com/cs/miscctrl/noogenwinforms.asp

(2) You can use your DataSet's ColumnMapping property to hide a column.

// Creating connection and command sting
string conStr = @"Provider=Microsoft.JET.OLEDB.4.0;data source=C:\northwind.mdb";
string sqlStr = "SELECT * FROM Employees";
// Create connection object
OleDbConnection conn = new OleDbConnection(conStr);
// Create data adapter object
OleDbDataAdapter da = new OleDbDataAdapter(sqlStr,conn);

// Create a dataset object and fill with data using data adapter's Fill method
DataSet ds = new DataSet();
da.Fill(ds, "Employees");

// Hide the column and attach dataset's DefaultView to the datagrid control
ds.Tables["Employees"].Columns["LastName"].ColumnMapping = MappingType.Hidden;
dataGrid1.DataSource = ds.Tables["Employees"];
AnswerRe: how to hide a column in Data Grid Pin
dabuskol20-Sep-05 19:14
dabuskol20-Sep-05 19:14 
QuestionNew serial device problem.. + an old one Pin
cue_ball19-Sep-05 22:21
cue_ball19-Sep-05 22:21 
QuestionRegarding WebBrower Control Pin
A.Grover19-Sep-05 21:46
A.Grover19-Sep-05 21:46 
AnswerRe: Regarding WebBrower Control Pin
seee sharp19-Sep-05 22:02
seee sharp19-Sep-05 22:02 
GeneralRe: Regarding WebBrower Control Pin
A.Grover19-Sep-05 22:43
A.Grover19-Sep-05 22:43 
GeneralRe: Regarding WebBrower Control Pin
seee sharp20-Sep-05 18:00
seee sharp20-Sep-05 18:00 
QuestionXML in C# Pin
deepscyberpulse19-Sep-05 20:40
deepscyberpulse19-Sep-05 20:40 
AnswerRe: XML in C# Pin
sreejith ss nair19-Sep-05 20:54
sreejith ss nair19-Sep-05 20:54 
QuestionHow do i Charge Credit Cards for my Program? Pin
mattylovestara19-Sep-05 20:27
mattylovestara19-Sep-05 20:27 
AnswerRe: How do i Charge Credit Cards for my Program? Pin
sreejith ss nair19-Sep-05 20:36
sreejith ss nair19-Sep-05 20:36 
AnswerRe: How do i Charge Credit Cards for my Program? Pin
seee sharp19-Sep-05 20:54
seee sharp19-Sep-05 20:54 
QuestionWindows Authentication Pin
pavan bhatara19-Sep-05 20:25
pavan bhatara19-Sep-05 20:25 
AnswerRe: Windows Authentication Pin
sreejith ss nair19-Sep-05 20:40
sreejith ss nair19-Sep-05 20:40 
QuestionOutput Caching Pin
Anonymous19-Sep-05 20:02
Anonymous19-Sep-05 20:02 
AnswerRe: Output Caching Pin
seee sharp19-Sep-05 20:09
seee sharp19-Sep-05 20:09 
Questionserialization in .Net Pin
Anonymous19-Sep-05 19:22
Anonymous19-Sep-05 19:22 
AnswerRe: serialization in .Net Pin
turbochimp19-Sep-05 19:34
turbochimp19-Sep-05 19:34 

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.