
Hi there,
I've tried to make an outlook inspired form using the RibbonBar but am not able to get the colours correct. Please see Picture 1 for how I want it to look and Picture 2 of how it actually looks.
I've tried going through each element via the 'Edit UI Elements' on the RibbonBar and haven't been able to find the element that controls this.
Any help will be appreciated.
Thanks,
Ray

hi.
I have 3 tables that structure showed in attached picture and I want to create the manual hierarchy. for this goal I do this steps :
1. add column to master and child's template from designer and set "FieldName" property to table file name
2. add GridVew relation from for these master/child template.
3. in the button event click, load tables and set GridView DataSource & child template DataSource from entity framwork:
using (var entity = new VaccinationEntities())
{
radGridView1.DataSource = entity.Patients.ToList();
childTemplate1.DataSource = entity.ChildVaccinations.ToList();
childTemplate2.DataSource = entity.ProblemBackgrounds.ToList();
}
but after load data just master template showed in GridView without child template.


Hi,
I have an eventhandler for the GraphicalViewItemFormatting event so I can change the look&feel of the items in the ganttview according to the contents. Now I also want to make it more clear which item is selected. Unfortunately I seem to be doing something wrong.
In the handler I have this part that should draw the border in red:
private void GanttViewElement_GraphicalViewItemFormatting(object sender, Telerik.WinControls.UI.GanttViewGraphicalViewItemFormattingEventArgs e)
{
if (e.ItemElement.Selected)
{
e.ItemElement.TaskElement.BorderColor = Color.Red;
e.ItemElement.TaskElement.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders;
e.ItemElement.TaskElement.BorderWidth = 6;
e.ItemElement.TaskElement.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
e.ItemElement.TaskElement.DrawBorder = true;
}
}
But the border keeps working in the standard way. There is only a slight difference between selected and non-selected items.
What part am I missing?

SetupDragDrop(radGridViewPreview);
SetupDragDrop(radGridView1);
}
private void SetupDragDrop(RadGridView grid)
{
grid.MultiSelect = true;
//handle drag and drop events for the grid through the DragDrop service
var svc = grid.GridViewElement.GetService<RadDragDropService>();
svc.PreviewDragStart += svc_PreviewDragStart;
svc.PreviewDragDrop += SvcPreviewDragDrop;
svc.PreviewDragOver += svc_PreviewDragOver;
//register the custom row selection behavior
grid.GridBehavior = new CustomGridBehavior();
}
private void svc_PreviewDragStart(object sender, PreviewDragStartEventArgs e)
{
e.CanStart = true;
}
private void SvcPreviewDragDrop(object sender, RadDropEventArgs e)
{
var rowElement = e.DragInstance as GridDataRowElement;
if (rowElement == null)
{
return;
}
e.Handled = true;
var dropTarget = e.HitTarget as RadItem;
var targetGrid = dropTarget.ElementTree.Control as RadGridView;
if (targetGrid == null || targetGrid == radGridView1)
{
return;
}
var dragGrid = rowElement.ElementTree.Control as RadGridView;
//Grab every selected row from the source grid, including the current row
List<GridViewRowInfo> dragRows = dragGrid.SelectedRows.ToList<GridViewRowInfo>();
if (dragGrid.CurrentRow != null)
{
GridViewRowInfo row = dragGrid.CurrentRow;
if (!dragRows.Contains(row)) dragRows.Add(row);
}
var dropTargetRow = dropTarget as GridDataRowElement;
int indexToMoveTo = targetGrid.RowCount;
if (dropTargetRow != null) indexToMoveTo = GetTargetRowIndex(dropTargetRow, e.DropLocation);
if (targetGrid != dragGrid)
{
e.Handled = true;
MoveRows(targetGrid, dragGrid, dragRows, indexToMoveTo);
}
else
{
MoveRowsWithinGrid(targetGrid, dragRows, indexToMoveTo);
}
}
private void svc_PreviewDragOver(object sender, RadDragOverEventArgs e)
{
if (e.DragInstance is GridDataRowElement || e.DragInstance is ListViewDataItem)
{
e.CanDrop = e.HitTarget is GridDataRowElement || e.HitTarget is GridTableElement || e.HitTarget is GridSummaryRowElement;
}
}
public class CustomGridBehavior : BaseGridBehavior
{
List<GridViewRowInfo> selectedRows = new List<GridViewRowInfo>();
public List<GridViewRowInfo> SelectedRows
{
get { return selectedRows; }
}
public override bool OnMouseDown(MouseEventArgs e)
{
selectedRows.Clear();
bool result = base.OnMouseDown(e);
selectedRows.AddRange(this.GridControl.SelectedRows);
return result;
}
}

Hello all together!
I am currently experiencing the below issues with RadTrackBar.
TrackBar.Minimum is set to 50.
TrackBar.Maximum is set to 150.
TrackBar.Value is set to 100.
I guess, everybody should now expect the track bar to move the knob in the exact middle of the control. But it simply doesn't. When looking at the track bar's minimum, maximum and value properties during FormLoad event, I discovered that the minimum changed to 19.
What I did next was searching for the number in the designer class of the respective form, assuming that Visual Studio somehow messed it up as it is always doing from time to time. But nothing found here. Setting the minimum value again in FormLoad fixes the problem, but this should not be the default approach when working with a RadTrackBar. So this must be a bug, right?

Hi,
I'm unable to mimic Master - Detail data display using RadGridView control. Let me know where I'm going wrong.
Following is my code:
private void BindGrid()
{
try
{
DataTable dtDept = new DataTable();
DataColumn dcDptID = new DataColumn("DeptID");
DataColumn dcDName = new DataColumn("DeptName");
dtDept.Columns.Add(dcDptID);
dtDept.Columns.Add(dcDName);
DataRow drDPT = dtDept.NewRow();
drDPT["DeptID"] = "10";
drDPT["DeptName"] = "Admin";
dtDept.Rows.Add(drDPT);
drDPT = dtDept.NewRow();
drDPT["DeptID"] = "11";
drDPT["DeptName"] = "Finance";
dtDept.Rows.Add(drDPT);
DataTable dtEmp = new DataTable();
DataColumn dcID = new DataColumn("EmpID");
DataColumn dcName = new DataColumn("EmpName");
DataColumn dcDeptID = new DataColumn("DeptID");
dtEmp.Columns.Add(dcID);
dtEmp.Columns.Add(dcName);
dtEmp.Columns.Add(dcDeptID);
DataRow dRow = dtEmp.NewRow();
dRow["EmpID"] = "1001";
dRow["EmpName"] = "Raaz";
dRow["DeptID"] = "10";
dtEmp.Rows.Add(dRow);
dRow = dtEmp.NewRow();
dRow["EmpID"] = "1002";
dRow["EmpName"] = "Amit";
dRow["DeptID"] = "11";
dtEmp.Rows.Add(dRow);
rdGridDemo.MasterTemplate.DataSource = dtDept ;
GridViewTemplate gvChildTemplate = new GridViewTemplate();
gvChildTemplate.AutoGenerateColumns = false;
gvChildTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
gvChildTemplate.AllowAddNewRow = false;
gvChildTemplate.EnableCustomGrouping = false;
gvChildTemplate.EnableGrouping = false;
gvChildTemplate.ShowGroupedColumns = false;
GridViewTextBoxColumn colEmpID = new GridViewTextBoxColumn();
colEmpID.Name = "colEmpID";
colEmpID.HeaderText = "Employee ID";
colEmpID.FieldName = "EmpID";
gvChildTemplate.Columns.Add(colEmpID);
GridViewTextBoxColumn colEmpName = new GridViewTextBoxColumn();
colEmpName.HeaderText = "Employee Name";
colEmpName.FieldName = "EmpName";
gvChildTemplate.Columns.Add(colEmpName);
GridViewTextBoxColumn colDeptID = new GridViewTextBoxColumn();
colDeptID.HeaderText = "Dept ID";
colDeptID.FieldName = "Dept ID";
gvChildTemplate.Columns.Add(colDeptID);
gvChildTemplate.DataSource = dtEmp;
rdGridDemo.Templates.Clear();
rdGridDemo.Relations.Clear();
rdGridDemo.MasterTemplate.Templates.Add(gvChildTemplate);
GridViewRelation relation = new GridViewRelation(rdGridDemo.MasterTemplate);
relation.ChildTemplate = gvChildTemplate;
relation.RelationName = "EmpDeptRelation";
relation.ParentColumnNames.Add("DeptID");
relation.ChildColumnNames.Add("DeptID");
rdGridDemo.Relations.Add(relation);
}
catch (Exception Ex)
{
lblMsg.Text = Ex.Message;
}
}
/* Thanks */


using System;using System.Linq;using System.Windows.Forms;using PlantManager.Classes;namespace PlantManager.Admin.UserManager{ public partial class frmUserManager : Form { public frmUserManager() { InitializeComponent(); } private void frmUserManager_Load(object sender, EventArgs e) { LoadData(); } private void LoadData() { QueryAgent qry = new QueryAgent(); qry.SQLText = "SELECT tbl_Users.UserID,tbl_Users.Username,tbl_Users.FirstName,tbl_Users.LastName,tbl_Users.PhoneExt,tbl_Users.EmailAddress FROM dbo.tbl_Users WHERE tbl_Users.Active = 1"; qry.exec_SelectQuery(); dgResults.DataSource = qry.DataSource; } private void mnuEditUser_Click(object sender, EventArgs e) { EditUser(); } private void dgResults_DoubleClick(object sender, EventArgs e) { EditUser(); } private void EditUser() { string UserID = dgResults.CurrentRow.Cells["UserID"].Value.ToString(); PubVar.OpenForm("Admin.UserManager.frmEditUser", new string[1] { UserID }, this, true); this.Dispose(); } }}