I recently upgraded the telerik controls from 2011.2.11.831 to 2015.1.331.20 and I am having an issue with the group by feature of the radgridview. Is this a known issue, and if is then is there a way to fix this?
grid1.png: The screen is stretched, the vertical scroll bar is clearly visible on the right.
grid2.png: As I reduce the width of the screen, the vertical scrollbar comes in with it as expected.
grid3.png: At this point the horizontal scroll bar is visible but the vertical one is not. This is with the horizontal scrollbar all the way to the right. Some content is also cut off.
grid4.png: This is how it looks before the telerik controls were updated to 2015.1.331.20.
I'm sure this question has been asked a 1000 times, but this will make 1001. I have a RadGridView and for the purposes of this discussion let make it a single column grid. I set the columntype to GridViewCommandColumn. Let's pretend I have 5 rows of data. On even numbered rows I DON'T want a button or any other editor/control. I just want a readonly bit of text to show (or no text at all for that matter). Basically, I want to change the even numbered rows/cells to a different cell type. In this case I want a readonly textbox or something similar. More generically, I want to know how to change individual cells at both design and runtime. Is this doable? If so, I could sure use some guidance.
Thanks ... Ed
I have a Windows application written in VB.Net. It has a RadDropDownList control that has Items added to it at Design time.
I would like to Filter the items in the RadDropDownList control or disable/enable some items in the RadDropDownList control depending on the data in the other controls on the WinForm.
I have tried looking at the documentation but it is not clear on how to filter the RadDropDownList or find some items to be enabled or disabled in the RadDropDownList when the control has items added at design time not at runtime.
I am using version 2015.3.1104.40 of the RadDropDownList.
Please help. Thanks!
I need to hide the "Editing & Proofing" and "Styles" group, achieved hide tab.
Sorry for my bad English
I'm going to fill my RadGridView by using multiple threads. My code is as follows but is not working. How can I do this?
BackgroundWorker[] workers =
new
BackgroundWorker[2];
private
void
frmTest_Load(
object
sender, EventArgs e)
{
for
(
int
col = 0; col < 300; col++)
grid.Columns.Add(
"Col "
+ col.ToString());
for
(
int
r = 0; r < 2; r++)
{
workers[r] =
new
BackgroundWorker();
workers[r].DoWork +=
new
DoWorkEventHandler(Worker_DoWork);
workers[r].RunWorkerCompleted +=
new
RunWorkerCompletedEventHandler(Worker_RunWorkerCompleted);
workers[r].RunWorkerAsync(grid.MasterView);
}
}
void
Worker_DoWork(
object
sender, DoWorkEventArgs e)
{
var rnd =
new
Random();
var info = (GridViewInfo)e.Argument;
var row =
new
GridViewDataRowInfo(info);
int
i = 0;
foreach
(GridViewCellInfo cell
in
row.Cells)
{
cell.Value = i++;
cell.Style.NumberOfColors = 1;
cell.Style.BackColor = Color.FromArgb(rnd.Next(0, 255), rnd.Next(0, 255), rnd.Next(0, 255));
cell.Style.CustomizeFill =
true
;
}
e.Result = row;
}
void
Worker_RunWorkerCompleted(
object
sender, RunWorkerCompletedEventArgs e)
{
grid.Rows.Add((GridViewDataRowInfo)e.Result);
}
I am attempting to move multiple selected items between Telerik ListView controls. If I was doing this with a Winforms Listbox, it would look like this:
private void button1_Click(object sender, EventArgs e)
{
for(int x = listBox1.SelectedIndices.Count - 1; x>= 0; x--)
{
int idx = listBox1.SelectedIndices[x];
listBox2.Items.Add(listBox1.Items[idx]);
listBox1.Items.RemoveAt(idx);
}
}
I want to set the current cell after performing a ResetBindings to allow seemless keyboard entry. In my example code below I would like to be able to edit the Name column after tabbing out of the Age column. The row appears highlighted but I must navigate to a different row before I can continue editing
public
class
MyData : IComparable
{
public
int
Age {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
MyData ()
{
}
public
MyData (
string
name,
int
age)
{
Name = name;
Age = age;
}
public
int
CompareTo (
object
obj)
{
var other = obj
as
MyData;
if
(other ==
null
)
return
0;
if
(
this
.Age > other.Age)
return
1;
if
(
this
.Age < other.Age)
return
-1;
return
0;
}
}
private
List<MyData> m_dataSource;
private
BindingSource myDataBindingSource =
new
BindingSource();
public
Form1()
{
InitializeComponent();
this
.radGridView1.MasterTemplate.DataSource = myDataBindingSource;
m_dataSource = PopulateData ();
this
.myDataBindingSource.DataSource = m_dataSource;
radGridView1.CellEndEdit += radGridView1_CellEndEdit;
}
void
radGridView1_CellEndEdit(
object
sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
var data =
this
.radGridView1.CurrentRow.DataBoundItem
as
MyData;
m_dataSource.Sort();
myDataBindingSource.ResetBindings(
false
);
if
(data !=
null
)
{
foreach
(var row
in
this
.radGridView1.Rows)
{
if
(row.DataBoundItem == data)
{
row.IsCurrent =
true
;
}
else
{
row.IsCurrent =
false
;
}
}
}
}
private
List<MyData> PopulateData ()
{
List<MyData> dataList =
new
List<MyData> ();
dataList.Add (
new
MyData (
"A"
, 1));
dataList.Add (
new
MyData (
"B"
, 7));
dataList.Add (
new
MyData (
"C"
, 3));
dataList.Add (
new
MyData (
"D"
, 5));
dataList.Add (
new
MyData (
"E"
, 15));
return
dataList;
}
I save RadGridView layout in SQL using the following code:
string
name = Microsoft.VisualBasic.Interaction.InputBox(
"Please insert the layout name:"
,
" "
);
using
(MemoryStream ms =
new
MemoryStream())
{
var lay =
new
Rahat.Layout();
lay.User_Id = 123;
lay.Title = name;
#region lay.Layout
grid.SaveLayout(ms);
var sw =
new
StreamWriter(ms);
sw.Flush();
ms.Position = 0;
var sr =
new
StreamReader(ms);
var myStr = sr.ReadToEnd();
lay.Layout = myStr;
#endregion
_dbRahat.Layouts.InsertOnSubmit(lay);
_dbRahat.SubmitChanges();
}
and load the layout using the following code:
var lay = _dbRahat.Layouts.First(l => l.Id.ToString() == cmbPreset.SelectedValue.ToString());
byte
[] byteArray = Encoding.UTF8.GetBytes(lay.Layout);
var stream =
new
MemoryStream(byteArray);
grid.LoadLayout(stream);
FillGrid();
The problem is that the grid colors (header cell colors, data cell colors) are not saved and loaded with SaveLayout() and LoadLayout() methods. How can I solve this problem?
Thank you
I am currently running Telerik WinControls 2009 Q2, I have a ribbon on an MDI form inheriting from the ShapeForm form class.
I would click run, it comes up without a hitch, sometimes it will be fine, most times however if I move the mouse, hover over a button, do nothing, it will throw a TargetInvocationException. This exception is pasted below. This application worked flawlessly till I added the RibbonControl to update the GUI.
Any suggestions on fixing this issue would be greatly appreciated. I am at a loss as to what might be going on but the common denominator seems to be the ribbon The inner exception is a null reference exception in Telerik.WinControls but I am at a loss what this might be.
Exception:
System.Reflection.TargetInvocationException was unhandled
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at Telerik.WinControls.UI.RadRibbonBar.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at SoftwareConfigurator.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="Telerik.WinControls"
StackTrace:
at Telerik.WinControls.Layouts.ContextLayoutManager.LayoutQueue.GetTopMost()
at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)
InnerException: