Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralRe: not deleting a row in datagrid Pin
phannon8615-Apr-08 23:53
professionalphannon8615-Apr-08 23:53 
GeneralRe: not deleting a row in datagrid Pin
sarilee16-Apr-08 0:01
sarilee16-Apr-08 0:01 
GeneralRe: not deleting a row in datagrid Pin
r aa j16-Apr-08 0:09
r aa j16-Apr-08 0:09 
GeneralRe: not deleting a row in datagrid Pin
sarilee16-Apr-08 0:13
sarilee16-Apr-08 0:13 
GeneralRe: not deleting a row in datagrid Pin
Ravenet16-Apr-08 0:14
Ravenet16-Apr-08 0:14 
GeneralRe: not deleting a row in datagrid Pin
sarilee16-Apr-08 0:19
sarilee16-Apr-08 0:19 
GeneralRe: not deleting a row in datagrid Pin
r aa j16-Apr-08 0:41
r aa j16-Apr-08 0:41 
GeneralRe: not deleting a row in datagrid Pin
sarilee16-Apr-08 1:00
sarilee16-Apr-08 1:00 
i created a datagrid with two columns(employee name,designation). If user select rows and if selected row contains employee name="aaaa" then don't delete that row and other rows can be deleted.
my code goes like this, initially i done dataview.AllowDelete=false to stop deletion.

private void dataGrid1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyData.ToString()=="Delete")
{
for(int i=0;i<dv.Table.Rows.Count;i++) //dv is dataview
{
if(((DataGrid)sender).IsSelected(i))
{
if(!(((DataGrid)sender)[0,i].ToString()=="aaaa"))
{
dv.AllowDelete=true;
dv.Delete(i);
datagrid.DataSource=dv;
dv.AllowDelete=false;
} } } } }

using this code when rows are selected and delete key is pressed first last column value get deleted not whole row.
GeneralSend email Pin
vanessa12315-Apr-08 22:29
vanessa12315-Apr-08 22:29 
GeneralRe: Send email Pin
Expert Coming15-Apr-08 22:47
Expert Coming15-Apr-08 22:47 
GeneralRe: Send email Pin
Ravenet16-Apr-08 0:15
Ravenet16-Apr-08 0:15 
GeneralIDE can not Load Project Pin
jason_mf15-Apr-08 22:24
jason_mf15-Apr-08 22:24 
GeneralAdd TrackBar to PropertyGrid - C# Pin
Member 223871415-Apr-08 21:41
Member 223871415-Apr-08 21:41 
GeneralRe: Add TrackBar to PropertyGrid - C# [modified] Pin
bscaer1-May-08 11:18
bscaer1-May-08 11:18 
GeneralRe: Add TrackBar to PropertyGrid - C# Pin
visualhint5-May-08 11:44
visualhint5-May-08 11:44 
GeneralProblem with tooltip Pin
rajeev8215-Apr-08 21:39
rajeev8215-Apr-08 21:39 
GeneralRe: Problem with tooltip Pin
mihai12315-Apr-08 22:21
mihai12315-Apr-08 22:21 
GeneralRe: Problem with tooltip [modified] Pin
cocoonwls15-Apr-08 22:30
cocoonwls15-Apr-08 22:30 
GeneralRe: Problem with tooltip Pin
rajeev8215-Apr-08 22:44
rajeev8215-Apr-08 22:44 
GeneralRe: Problem with tooltip Pin
Expert Coming15-Apr-08 22:49
Expert Coming15-Apr-08 22:49 
GeneralRe: Problem with tooltip Pin
cocoonwls15-Apr-08 23:28
cocoonwls15-Apr-08 23:28 
GeneralRe: Problem with tooltip Pin
rajeev8216-Apr-08 0:15
rajeev8216-Apr-08 0:15 
GeneralAvoid having more than 5 arguments in the Method:'{0}' Pin
preetej15-Apr-08 21:36
preetej15-Apr-08 21:36 
GeneralRe: Avoid having more than 5 arguments in the Method:'{0}' Pin
Christian Graus15-Apr-08 22:25
protectorChristian Graus15-Apr-08 22:25 
GeneralRe: Avoid having more than 5 arguments in the Method:'{0}' Pin
Vikram A Punathambekar15-Apr-08 22:49
Vikram A Punathambekar15-Apr-08 22:49 

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.