Telerik Forums
UI for WPF Forum
9 answers
202 views
Hello, I want to generate columns of grid automaticaly. Everything works good except that generated colums have no data. Here is my code:
            try
{
LoadDataTable = SqlHelper.GetTable(LoadProcedureSelectName, Args);
}
catch (Exception e)
{
CreateSelectProcedure(LoadProcedureSelectName);
}
LoadData(LoadDataTable);

protected void LoadData(DataTable dataTable)
        {
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataMember = null;
            dataGridView1.Columns.Clear();
            LoadDataTable = dataTable;
            dataGridView1.ItemsSource = LoadDataTable.DefaultView;
            if (dataGridView1.Columns.Count == 0)
                GenerateColumns();
}
        protected void GenerateColumns()
        {
            dataGridView1.Columns.Clear();
            dt = SqlHelper.GetTable("base_Fields_SelectVisible", new string[] { "@UserID", Globals.UserID, "@TableName", _TableName });
            foreach (DataRow dr in dt.Rows)
            {
                if (dr["Type"].ToString().Equals("string"))
                {
                    GenerateTextBoxWPF(dr);
                }
            }
        }

private void GenerateTextBoxWPF(DataRow dr)
        {
            GridViewColumn col = new GridViewColumn();
            col.Name = dr["FieldName"].ToString();
            col.Header = dr["Caption"].ToString();
            col.UniqueName = dr["FieldID"].ToString();
            col.IsReadOnly = true;
            col.Width = Convert.ToInt32(dr["width"].ToString());

            dataGridView1.Columns.Add(col);
            if (dr["Visible"].ToString() == "1")
            {
                dataGridView1.Columns[dataGridView1.Columns.Count - 1].IsVisible = true;
            }
            else
            {
                dataGridView1.Columns[dataGridView1.Columns.Count - 1].IsVisible = false;
            }
}

What i do wrong. This technique worked very well with standart wpf grid and also with devExpress grid.


Tsvyatko
Telerik team
 answered on 23 Dec 2009
1 answer
653 views
Hello,
    I've implemented an undo capability into the grid. If a user changes the value of a field but they want to reverse the change they will click on the undo button and the change is undone. This undo functionality remembers only the last change. I've implemented this using List's and by clearing out the grid and re-building the grid using the data in the lists. It works but it's slow. Imagine re-building a 2000 row X 800 column grid. I tried saving the previous state of the data in the grid in another datatable and then getting rid of the current datatable and making this datatable the current one but I ran into many problems. Because rows and columns can be deleted the datatable rejectchanges() function is of no use.

Any ideals would be appreciated.

Thanks

Tsvyatko
Telerik team
 answered on 23 Dec 2009
2 answers
84 views
If you open Demo application and select Grid --> First Look --> Filter near any column. As soon as you select a dropdown "Is Equal To" to change the mode you got an excetpion: Recursive Call to Automation Peer API is not valid.

I think this is a bug related to the combobox, I opened another thread this morning related to the fact that RadCombo is raising exception in this release.

Hope this helps,

Ivan
4ward s.r.l.
Top achievements
Rank 1
 answered on 23 Dec 2009
5 answers
263 views
Hello!

I am willing to buy your wpf controls, but before, I need to be sure that I do following stuff with it:

1. drag items to other controls than the treeview itself (for that case, if would be nice if I still would have the "drag tooltip")
2. being able to change the texts "drop in", "drop before", etc...
3. Do filtering (I explain here what I need):
I have the following structure: 
aaa
   bbb
   ccc
      fff
ddd
   eee 
I enter a filter criteria "fff". Will the node be displayed, even though the node "aaa" and "ccc" do not match the criteria?

Thanks for your quick answer.

Best regards,

Marc Wuergler
Miroslav
Telerik team
 answered on 23 Dec 2009
1 answer
64 views
Hi,
  We would like to place a combobox in gridview header.How can we add the template in the gridview header.Kindly let us know your feedback  for the same on an urgent basis.

Thanks
Anurag
Missing User
 answered on 23 Dec 2009
4 answers
147 views
Is there a way to dock normal WPF Windows in the RadDock like you can with the winforms implementation ? Is there a way to dock the Telerik RadWindow control at all ? 

When I add items to the RadPaneGroup it always has to be a RadPane or iSplitItem.

I'm new to the WPF dock and really keen to get an old winforms application using RadDock for winforms upgraded to wpf.
Antonio
Top achievements
Rank 1
 answered on 23 Dec 2009
2 answers
40 views
Hi team,

Im getting "get_IsInDesignMode()    " error while trying create and object of Radwindow

here is the stack trace.

StackTrace = "   at Telerik.Windows.Controls.RadWindow.get_IsInDesignMode()    at Telerik.Windows.Controls.RadWindow..ctor()    at

please let me know how i can resolve this

-raj
orion systems india
Miroslav Nedyalkov
Telerik team
 answered on 23 Dec 2009
2 answers
114 views
A customer is asking me if it's possible to do the following:
  • Entering time directly in the box, but filtering possible value as 00-23 for hours and 00:59 for minutes
  • Allowing maximum of 4 characters. I.e. 2359
  • Automatically SelectAll content of the input box on focus

Kind regards
4ward s.r.l.
Top achievements
Rank 1
 answered on 22 Dec 2009
2 answers
179 views
I need to skip the inputBox focus on Tab in order to speed up data entry through keyboard, but even if we set IsTabStop property to false on the DatePicker, the InputBox on its left is still getting focus on Tab, is it possible to change this behaviour ?

Thanks and regards,

Ivan
4ward s.r.l.
Top achievements
Rank 1
 answered on 22 Dec 2009
1 answer
104 views
FYI,
    The first column of my grid is readonly. I needed to programmatically  add a value to a cell in this column. This is how to do it:

<data table>.Columns[<column index>].ReadOnly = false;

<data table>.Rows[<row index>][<column index>] = <value>;

<data table>.Columns[<column index>].ReadOnly = false;

column index is 0 for me.
Nedyalko Nikolov
Telerik team
 answered on 22 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?