Hello,
I use a hierarchical grid in my application. The grid has a master level and a child level.
I like the integrated search function of the grid and want to use it in my project.
I have a problem when I use the UseScrollbarsInHierarchy feature of the grid.
When I set it to False the search function works fine which means the table scrolls to each search hit (child and master hit alike) when the arrow buttons next to the search field are used.
When I set it to True (desired option because the child level can have several hundred rows) the grid does not scroll to the search hits anymore.
How can I achieve that the master scrollbar scrolls to the search hit and the child scroll bar too?
I tried using Databinding / Object Relational Mode / Load On Demand with the same result as described above.
I use the latest version of the UI for WinForms with .NET 3.0 (Unfortunately the highest version of target System).
Thanks for your help.
Regard
Ingo
Hello,
I'm trying to cancel the RadGridView's FilterChanging event after the user enters text into the filtering row, but doing so does not undo any additional text that the user may have added to the filtering row. I have tried the following lines of code but neither worked (and I discovered the Value property does not match the RadGridView's filtering row text - it matches the actual value of the filter):
radGridView1.FilterDescriptors[0].Value = oldValue;
radGridView1.MasterView.TableFilteringRow.Cells[0].Value = oldValue;
How can I set the filtering row text back to its original value?
Thank you!
Hello,
I would like to display a RadColorBox inside a RadCommandBar. This would allow the user to select a color and to show him which color is currently selected.
Is this possible?
A DateTimePicker can be easily hosted inside the command bar inside a CommandBarHostItem. But I can get it to work with a RadColorBox
Thank You for Your help
Regards,
Ingo
Dear readers,
i have a scheduler grouped by resources. I use a dropdown (selectionmode=Multisimple) to switch the resources on/off to show them side by side in the scheduler and AddHandler to each item in the dropdown.
In Form_Load() i use the following code
' Populates the dropdown
ddlResourcen.DataSource = SchedulerDataDataSet.Resources
ddlResourcen.ValueMember = "ID"
ddlResourcen.DisplayMember = "Name"
For Each item As RadListDataItem In Me.ddlResourcen.Items
AddHandler item.RadPropertyChanged, AddressOf SelectedChanged
Next
Here is the code for SelectedChanged()
Private Sub SelectedChanged()
AddResources()
End Sub
It simply switch the resources on/off.
I can move appointment between resources, move and resize them and all is fine, until i try to save it to the database.
I use just the code suggested in the demos with just one change to show my resources in different colors at the last line
When i call the Sub UpdateDB the stored appointments/resources data is correct, but my handlers for to the drowdown items are not longer
working and just one resource is visible because my multi preselection is gone.
Private Sub UpdateDB()
AppointmentsResourcesTableAdapter.Adapter.AcceptChangesDuringUpdate = False
Dim deletedRelationRecords As schedulerDataDataSet.AppointmentsResourcesDataTable = TryCast(Me.SchedulerDataDataSet.AppointmentsResources.GetChanges(DataRowState.Deleted), schedulerDataDataSet.AppointmentsResourcesDataTable)
Dim newRelationRecords As schedulerDataDataSet.AppointmentsResourcesDataTable = TryCast(Me.SchedulerDataDataSet.AppointmentsResources.GetChanges(DataRowState.Added), schedulerDataDataSet.AppointmentsResourcesDataTable)
Dim modifiedRelationRecords As schedulerDataDataSet.AppointmentsResourcesDataTable = TryCast(Me.SchedulerDataDataSet.AppointmentsResources.GetChanges(DataRowState.Modified), schedulerDataDataSet.AppointmentsResourcesDataTable)
Dim newAppointmentRecords As schedulerDataDataSet.AppointmentsDataTable = TryCast(Me.SchedulerDataDataSet.Appointments.GetChanges(DataRowState.Added), schedulerDataDataSet.AppointmentsDataTable)
Dim deletedAppointmentRecords As schedulerDataDataSet.AppointmentsDataTable = TryCast(Me.SchedulerDataDataSet.Appointments.GetChanges(DataRowState.Deleted), schedulerDataDataSet.AppointmentsDataTable)
Dim modifiedAppointmentRecords As schedulerDataDataSet.AppointmentsDataTable = TryCast(Me.SchedulerDataDataSet.Appointments.GetChanges(DataRowState.Modified), schedulerDataDataSet.AppointmentsDataTable)
Try
If newAppointmentRecords IsNot Nothing Then
Dim newAppointmentIds As New Dictionary(Of Integer, Integer)()
Dim oldAppointmentIds As New Dictionary(Of Object, Integer)()
For i As Integer = 0 To newAppointmentRecords.Count - 1
oldAppointmentIds.Add(newAppointmentRecords(i), newAppointmentRecords(i).ID)
Next
AppointmentsTableAdapter.Update(newAppointmentRecords)
For i As Integer = 0 To newAppointmentRecords.Count - 1
newAppointmentIds.Add(oldAppointmentIds(newAppointmentRecords(i)), newAppointmentRecords(i).ID)
Next
If newRelationRecords IsNot Nothing Then
For i As Integer = 0 To newRelationRecords.Count - 1
newRelationRecords(i).AppointmentID = newAppointmentIds(newRelationRecords(i).AppointmentID)
Next
End If
End If
If deletedRelationRecords IsNot Nothing Then
AppointmentsResourcesTableAdapter.Update(deletedRelationRecords)
End If
If deletedAppointmentRecords IsNot Nothing Then
AppointmentsTableAdapter.Update(deletedAppointmentRecords)
End If
If modifiedAppointmentRecords IsNot Nothing Then
AppointmentsTableAdapter.Update(modifiedAppointmentRecords)
End If
If newRelationRecords IsNot Nothing Then
AppointmentsResourcesTableAdapter.Update(newRelationRecords)
End If
If modifiedRelationRecords IsNot Nothing Then
AppointmentsResourcesTableAdapter.Update(modifiedRelationRecords)
End If
Me.SchedulerDataDataSet.AcceptChanges()
Catch ex As Exception
MessageBox.Show(String.Format("An error occurred during the update process:" & vbLf & "{0}", ex.Message))
Finally
If deletedRelationRecords IsNot Nothing Then
deletedRelationRecords.Dispose()
End If
If newRelationRecords IsNot Nothing Then
newRelationRecords.Dispose()
End If
If modifiedRelationRecords IsNot Nothing Then
modifiedRelationRecords.Dispose()
End If
End Try
AddResources()
End Sub
Private Sub AddResources()
Me.rscMain.Resources.Clear()
Dim i As Integer = 0
For Each Row As DataRow In SchedulerDataDataSet.Tables("Resources").Rows
Dim resource As New Resource()
resource.Id = New EventId(i + 1)
resource.Name = Row("Name").ToString
resource.Color = Color.FromName(Row("SystemColor"))
If ddlResourcen.Items(i).Selected = True Then
Me.rscMain.Resources.Add(resource)
End If
i = i + 1
Next
Me.rscMain.GroupType = GroupType.Resource
Me.rscMain.ActiveView.ResourcesPerView = 4
End Sub
I belive this takes places because the SchedulerDataDataSet was changed, because when i reuse the code
' Populates the dropdown
ddlResourcen.DataSource = SchedulerDataDataSet.Resources
ddlResourcen.ValueMember = "ID"
ddlResourcen.DisplayMember = "Name"
For Each item As RadListDataItem In Me.ddlResourcen.Items
AddHandler item.RadPropertyChanged, AddressOf SelectedChanged
Next
i can again use it, but my preselection is gone, of course.
Any suggestions how to stop this behaviour.
Kind regards
Martin Gartmann
01.
internal
class
RadTextBoxWithDropDownButton : RadTextBox
02.
{
03.
public
RadDropDownButtonElement DropDownButtonElement {
get
;
private
set
; }
04.
05.
public
RadTextBoxWithDropDownButton()
06.
{
07.
DropDownButtonElement =
new
RadDropDownButtonElement
08.
{
09.
Padding =
new
Padding(2, 0, 2, -2),
10.
Margin =
new
Padding(0, 0, 0, 0),
11.
Text =
" "
12.
};
13.
14.
var stackLayoutElement =
new
StackLayoutElement
15.
{
16.
Orientation = Orientation.Horizontal,
17.
Margin =
new
Padding(1, 0, 1, 0)
18.
};
19.
20.
stackLayoutElement.Children.Add(DropDownButtonElement);
21.
22.
var textBoxItem = TextBoxElement.TextBoxItem;
23.
TextBoxElement.Children.Remove(textBoxItem);
24.
25.
var dockLayoutPanel =
new
DockLayoutPanel();
26.
dockLayoutPanel.Children.Add(stackLayoutElement);
27.
dockLayoutPanel.Children.Add(textBoxItem);
28.
DockLayoutPanel.SetDock(textBoxItem, Telerik.WinControls.Layouts.Dock.Left);
29.
DockLayoutPanel.SetDock(stackLayoutElement, Telerik.WinControls.Layouts.Dock.Right);
30.
31.
TextBoxElement.Children.Add(dockLayoutPanel);
32.
33.
TextBoxElement.Padding =
new
Padding(1, 1, 1, 1);
34.
Margin =
new
Padding(0, 1, 0, 0);
35.
}
36.
}
Hello there ,
i have RadGridView hierarchy with 3 level
i want to do the following
1- when expand any row at the first level , i need to collapse any other expanded row.
2- when expand any row at the first level i need to dispose any data source assigned to other rows , in other words i want to keep my memory to contain only the datasource of current expanded row.
for example
i expanded first row , then rowsourceneed event will be fired and second level will be binded
when expand second row , also rowsourceneed event will be fired and second level will be binded
now i need to clear the datasource for first expanded row , and when first row expanded again it will force rowsourceneed event to be fired again
please help me.
regards,
Ahmed.
hi, i use raddropdownlist to get value from raddatagrid when i click cell
this my dropdownlist databind code
private void showKategori()
{
try
{
string query = "select ID_Kategori, Nama from Kategori";
SqlDataAdapter da = new SqlDataAdapter(query, con);
con.Open();
DataSet ds = new DataSet();
da.Fill(ds, "Kategori");
ddlkat.DisplayMember = "Nama";
ddlkat.ValueMember = "ID_Kategori";
ddlkat.DataSource = ds.Tables["Kategori"];
//ddlkat.Text = "Pilih Kategori";
con.Close();
}
catch (Exception ex)
{
con.Close();
RadMessageBox.Show(ex.Message.ToString());
}
}
and this my datagrid code
try
{
con.Open();
SqlCommand cmd = new SqlCommand("Select a.ID_Obat,a.ID_Kategori, b.Nama,a.ID_Supplier, c.Nama, a.Nama, a.Stok, a.Harga, a.Tanggal_Kadaluarsa,a.Tanggal_Masuk From Obat a JOIN Kategori b ON a.ID_Kategori=b.ID_Kategori JOIN Supplier c ON a.ID_Supplier=c.ID_Supplier", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
cmd.ExecuteNonQuery();
if (ds.Tables[0].Rows.Count > 0)
{
Griddataobat.DataSource = ds.Tables[0];
Griddataobat.Columns[0].HeaderText = "ID Obat";
Griddataobat.Columns[1].HeaderText = "IDKat";
Griddataobat.Columns[2].HeaderText = "Kategori";
Griddataobat.Columns[3].HeaderText = "IDSup";
Griddataobat.Columns[4].HeaderText = "Supplier";
Griddataobat.Columns[5].HeaderText = "Nama Obat";
Griddataobat.Columns[6].HeaderText = "Stok Obat";
Griddataobat.Columns[7].HeaderText = "Harga Satuan";
Griddataobat.Columns[8].HeaderText = "Tanggal Kadaluarsa";
Griddataobat.Columns[9].HeaderText = "Tanggal Obat Masuk";
Griddataobat.MasterGridViewTemplate.BestFitColumns();
}
con.Close();
}
catch(Exception ex)
{
con.Close();
RadMessageBox.Show(ex.Message.ToString());
}
and this my datagrid when cell is click
private void Griddataobat_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
txtnamaobat.Text = Griddataobat.Rows[e.RowIndex].Cells[0].Value.ToString();
ddlkat.SelectedValue = Griddataobat.Rows[e.RowIndex].Cells[1].Value.ToString();
}
but my raddropdownlist not change after i click rad gridview
Hi!
I'm trying to filter in a Treeview. The filter is working, but I need to show all the childs from the result-nodes.
I know there is custom filtering, but I have no clue how to do this.
Thanks in advance
Willi
I am using Win7 SP1-64. I've had VS 2013 installed for a year or so. I installed a demo version of the UI for WinForms about a month ago. I installed VS 2015 this week, but didn't run it. (Got busy elsewhere.) I removed the demo version of UI for WinForms and installed the licensed version shortly after installing VS 2015.
So, I have both VS 2013 (Pro, Update 5) and VS 2015 (Community) on the PC.
VS 2013 has a Telerik menu and the Telerik WinForms VSExtensions is an installed extension. VS 2015 does not.have a Telerik menu and the Telerik WinForms VSExtensions is not listed.
What do I need to do to enable UI for WInforms in VS 2015? My first inclination is to reinstall it, but I hate doing that without some idea of why it's necessary.