We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Readonly cell while paste

Hi, my first 2 columns of the DataBoundGrid are readonly. when i insert new rows and try to copy using the below command it says can not set the column value this.m_ListingGrid.Model.CutPaste.Paste(); i have set the IgnoreReadOnly property but this works just once next time again it throws the same error. m_ListingGrid.Model.IgnoreReadOnly = true; Is there any other way that i can make those cells writable during insert paste and other time just readonly

3 Replies

AD Administrator Syncfusion Team February 9, 2005 07:34 AM

Hi, try this: bool inPaste = false; private void gridControl1_ClipboardPaste(object sender, GridCutPasteEventArgs e) { if (inPaste) return; inPaste = true; gridControl1.Model.IgnoreReadOnly = true; gridControl1.Model.CutPaste.Paste(); e.Handled = true; gridControl1.Model.IgnoreReadOnly = false; inPaste = false; } Stefan >Hi, >my first 2 columns of the DataBoundGrid are readonly. >when i insert new rows and try to copy using the >below command it says can not set the column value >this.m_ListingGrid.Model.CutPaste.Paste(); > >i have set the IgnoreReadOnly property but this works just once next time again it throws the same error. >m_ListingGrid.Model.IgnoreReadOnly = true; > >Is there any other way that i can make those cells writable during insert paste and other time just readonly > > >


AD Administrator Syncfusion Team February 9, 2005 11:08 PM

Now also i m getting the same error cannot set the column. regards Pratiksha >Hi, > >try this: > > > > >bool inPaste = false; > >private void gridControl1_ClipboardPaste(object sender, GridCutPasteEventArgs e) >{ > if (inPaste) > return; > > inPaste = true; > gridControl1.Model.IgnoreReadOnly = true; > gridControl1.Model.CutPaste.Paste(); >e.Handled = true; > gridControl1.Model.IgnoreReadOnly = false; > inPaste = false; >} > > >Stefan > > >>Hi, >>my first 2 columns of the DataBoundGrid are readonly. >>when i insert new rows and try to copy using the >>below command it says can not set the column value >>this.m_ListingGrid.Model.CutPaste.Paste(); >> >>i have set the IgnoreReadOnly property but this works just once next time again it throws the same error. >>m_ListingGrid.Model.IgnoreReadOnly = true; >> >>Is there any other way that i can make those cells writable during insert paste and other time just readonly >> >> >>


AD Administrator Syncfusion Team February 10, 2005 06:46 PM

I think I probably misunderstood you. From your description it sounds like you try to paste into row 0. Did you change the clipboard flags? If so, make sure that GridDragDropFlags.RowHeader and GridDragDropFlags.ColHeader is not set. You could make sure these flags are not set with following code: >>private void gridControl1_ClipboardPaste(object sender, GridCutPasteEventArgs e) >>{ e.ClipboardFlags &= ~(GridDragDropFlags.RowHeader |GridDragDropFlags.ColHeader ) >>} If you keep having trouble please post a small sample project that shows what you try to do. Then I can fill in the missing parts. Thanks, Stefan

Loader.
Live Chat Icon For mobile
Up arrow icon