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

Customized binding in DataGrid

Hi everybody, I have a DataSet containing some DataTables and some DataReltions between them. I bind DefaultViewManager of the DataSet to a DataGrid on a Windows Form: 1. I want to allow a kind of selective navigation between my DataTables. I mean i want user to see only some of DataRelations of each DataTable below each row in DataGrid not all of them. Is this possible? 2. DataGrid displays the name of each DataRelation object in DataSet by default. But i would like to display a custom string, e.g. its caption. What can i do? 3. I attached an EventHandler to OnRowChanging of one of my DataTables. I check if a column is null, like this: private void RowChanging(object sender, RowChangeEvent e) { if (e.Row.mt_name.Length == 0) { string errorMessage = String.Format(messages.GetString("columnNull"), pcDataSet.material_type.mt_nameColumn.Caption); throw (new System.Exception(errorMessage)); } } The DataGrid displays my error message plus a "Do you want to correct the value?" in a dialog box with Yes and No buttons. Is this behavior overridable? Can i show a customized dialog box? 4. On of my cloumn in a DataTable have a unique constraint. When user enters a duplicate value, again that dialog box appears saying: "The column "mt_name" is constrained to be unique. Do you want to correct the value?". How can i catch this error? Any comment is really appreciated. Jack

Live Chat Icon For mobile
Up arrow icon