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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Several questions on SfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

125639 Aug 30,2016 02:00 PM UTC Sep 2,2016 01:59 AM UTC WPF 4
loading
Tags: SfDataGrid
Dov
Asked On August 30, 2016 02:00 PM UTC

Hi,

I'm working with two SfDataGrid's, and I allow the user to drag data from one SfDataGrid to the other.
 
1. Is it possible to view different columns on each SfDataGrid?
In the example I added I want to view columns name and age on the left table and columns rollno, name and grade on the right one,
So that dragging from one table to the other will result in displaying the correct data on each column


2. Is it possible to disable the gray row highlight that occur when I press on a row?

3. Is it possible to drag and drop without moving the row to the other table? Just copy - paste it.
 

Regards,

Dov

Attachment: RowDragandDropInSfDataGrid_WPF_66bae51f.rar

Dov
Replied On August 31, 2016 10:00 AM UTC

I've managed to solve Q. 3 by myself.

Dov.

Jai Ganesh S [Syncfusion]
Replied On August 31, 2016 02:06 PM UTC

Hi Dov, 
 
Please find the responses for your queries as below, 
 
Query 1: 
 
You can show the different columns on each SfDataGrid by wiring the AutoGeneratingColumn event like below, 
 
this.sfdatagrid.AutoGeneratingColumn += sfdatagrid_AutoGeneratingColumn; 
this.sfdatagrid1.AutoGeneratingColumn += sfdatagrid1_AutoGeneratingColumn; 
 
void sfdatagrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) 
{ 
    if (e.Column.MappingName == "RollNo" || e.Column.MappingName == "Grade") 
        e.Cancel = true; 
 
} 
 
void sfdatagrid1_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) 
{ 
    if (e.Column.MappingName == "Age") 
        e.Cancel = true; 
} 
 
Please find the sample for this from the attached location. 
 
If we misunderstood your requirement, then please share a more detail for your requirement. This would be more helpful for us to proceed further. 
 
Query 2: 
 
You can disable the gray row highlight for the selected row by setting the RowSelectionBrush as Transparent like below, 
 
<syncfusion:SfDataGrid x:Name="sfdatagrid" 
                               Grid.Column="0" 
                               ItemsSource="{Binding Stud}" 
                               AutoGenerateColumns="True"                                                               
                               SelectionMode="Single" 
                               RowSelectionBrush="Transparent" 
                               AllowEditing="True"   
                               AllowDrop="True" 
                               AllowFiltering="False" 
                               AllowGrouping="True" 
                               ShowRowHeader="True"  
                               ShowGroupDropArea="False" 
                                
                               /> 
 
 
Regards, 
Jai Ganesh S 


Dov
Replied On September 1, 2016 01:56 PM UTC

Thank you very much. It's working great.

Jai Ganesh S [Syncfusion]
Replied On September 2, 2016 01:59 AM UTC

Hi Dov, 
 
Thank you for the update. 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Jai Ganesh S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;