Telerik Forums
UI for WinForms Forum
2 answers
233 views

 

Hi,

 

I am displaying customer data [Id, Name and Address] in grid view. I also need to display some calculated value “Customer Points” in the grid. For the “Customer Points” I have added a GridViewTextBoxColumn “txtCustomerPoints” to the grid.

 

 

 

For displaying data in “txtCustomerPoints” i am using the CellFormatting Event as below:

 

        private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)

        {

            try

            {

                string columnUniqueName = ((GridViewDataColumn)e.CellElement.ColumnInfo).UniqueName;

                if (columnUniqueName == "txtCustomerPoints " )

                {

                    if (IsColumnExistsInGrid(RadGridView1.MasterGridViewTemplate, columnUniqueName))

                    {

                        RadGridView1.GridElement.BeginUpdate();

                        e.CellElement.RowInfo.Cells[columnUniqueName].Value = "Some Calculated Value";

                        RadGridView1.GridElement.EndUpdate();

                    }

                }

            }

            catch (Exception ex)

            {

                throw ex;

            }

        }

 

 

But this generate an error on this line:

e.CellElement.RowInfo.Cells[columnUniqueName].Value = "Some Calculated Value";

 

The error is:

 

ex = {"Object reference not set to an instance of an object."}               

 

StackTrace       "   at MSMainPrj.FormsEmbedded.Booking. RadGridView1_ValueChanging(Object sender, ValueChangingEventArgs e) in D:\\Users\\Yaqub.Ahmad\\CS2\\trunk\\code\\MSMainPrj\\FormsEmbedded\\Booking.cs:line 1755\r\n   at Telerik.WinControls.UI.RadGridView.OnValueChanging(Object sender, ValueChangingEventArgs e)\r\n   at Telerik.WinControls.UI.RadGridView.CallValueChanging(Object sender, ValueChangingEventArgs e)\r\n   at Telerik.WinControls.UI.GridViewCellInfo.set_Value(Object value)\r\n   at MSMainPrj.Libraries.TelerikGridHelper.SetGridColumnValue(RadGridView grid, CellFormattingEventArgs e, String columnName, Object value) in D:\\Users\\Yaqub.Ahmad\\CS2\\trunk\\code\\MSMainPrj\\Libraries\\TelerikGridHelper.cs:line 292"      string

 

TargetSite         {Void RadGridView1_ValueChanging(System.Object, Telerik.WinControls.UI.ValueChangingEventArgs)}      System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

Kindly help me to update a custom column's value.

Thanks.

 


yaqub
Top achievements
Rank 2
 answered on 27 Aug 2009
6 answers
215 views
Hello,

I'm having trouble with some controls I've added to gridview cells. I've followed the procedure in your documentation to add the controls via the CellFormatting Event. I have added a RadCheckBox to one column and a RadButton to another. Everything works fine at first, but if there's enough rows for scrolling to occur, the controls will actually migrate from one row to another when scrolling is performed. In fact, if you scroll down via the scroll bar, the controls stay in their correct row, but if you scroll up, the controls seem to stay put while the rows rotate around them. 

Please help!

Thanks!
Jeremy
Julian Benkov
Telerik team
 answered on 27 Aug 2009
3 answers
343 views

private void managerGrid_ValueChanged(object sender, EventArgs e)
        {
            if (sender is GridCheckBoxCellElement)
            {
                GridCheckBoxCellElement cell = (GridCheckBoxCellElement)sender;
                RadCheckBoxEditor checkbox = cell.Children[0] as RadCheckBoxEditor;  <- Error

How???
Julian Benkov
Telerik team
 answered on 27 Aug 2009
4 answers
342 views
Hi,

I'm using RadDock and I am trying to find a way within the RadDock.DockWindowClosing event handler to know if the form on the ActiveWindow has set Cancel = true in the Form.Closing handler.  I manually close the form in the DockWindowClosing handler like this:
  103             HostWindow window = dockMain.ActiveWindow as HostWindow;
  104             Form form = window.Content.FindForm();
  105             form.Close();

The form object is the correct form. There may be a reason why the form should not be closed and will set
the Cancel property to true; I can not find a way to detect this state. I really need to be able to cancel
a DockWindowClosing event based on the underlying form closing event.
How can I do this?

Thanks,
Mike



Georgi
Telerik team
 answered on 27 Aug 2009
1 answer
155 views

I the Beta Version there was an AutoDispose Property on RadDock, that was removed with 9.2 - now I assume the right way to have AutoDispose Functionality is to set the CloseAction Property on the Document or Tool Windows as needed(?).

The docs are unclear, even the introduction text mentions the AutodDispose Property, And it can be found searching the online Reference / Docs.

Regards
Erwin
Georgi
Telerik team
 answered on 27 Aug 2009
1 answer
109 views
Hello
I have a radgrid gouped by a collumn (categoryid)
I need to get the value of categoryid when the user clicks on the goup row. I tried to use currentrow, but all the cellvalues are null. DataBindItem is also null.

Thank you!
Laura Serban
Top achievements
Rank 1
 answered on 27 Aug 2009
2 answers
180 views
Hi!
   I have a RadGridView for windows on my form which is data bound. Now according to requirements, i have set Autogeneratecolumns to false and programmatic-ally added some GridViewTextBox columns. The user can also add a new Row by clicking Add new Row Button. But before adding a new Row i need to check whether, user has left some of the columns empty or filled them with invalid values. IN that case i need to prompt the user about mistakes and cancel the add new Row. I have tried so much but i could not validate the grid. I desire to set error on each column instead of Rows.I have found some solutions but was unable to use any of them. Any help will be greatly appreciated.

Thanks
Vassil Petev
Telerik team
 answered on 27 Aug 2009
1 answer
147 views
Hi

Reading the post answer in MDI CHild Issue and Window State, indicates that there is an issue that was meant to be fixed with RadForms and the MenuStrip control in the latest Q2 2009 build.

I however have the latest production build (2009.2.9.729), and I am still having a problem with an MDI Child using a MenuStrip, and the behaviour of the child window bar. When maximising the child window, the bar does not disappear as it should, and does not repaint.

The MDI parent window is a RadRibbonForm.

Other MDI child windows that inherit from RadForm work fine (they don't have the MenuStrip on them), maximise correctly without the issue.

Please advise as to how to resolve this problem.

The project targets .NET 2.0 framework, development machine running on XP Pro SP3

Regards

Jayden MacRae

Deyan
Telerik team
 answered on 27 Aug 2009
0 answers
169 views

hai! I have use below code for ascx control page navigation depending upon ascx page name using panel bar...I need breadcrumb for ascx page navigation..can anyone findout some samples...


public
string TrackedUserControl

 

{

 

get { return ViewState["TrackedUserControl"] as string; }

 

 

set { ViewState["TrackedUserControl"] = value; }

 

}

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

if (!IsPostingFromMenu() && IsPostBack)

 

ReloadContent();

}

 

protected void PanelNavigation_PanelNavigationItemClick(object sender, RadPanelBarEventArgs e)

 

{

 

LoadContent(e.Item.Value);

 

}

 

 

private void LoadContent(string menuItemName)

 

{

 

string ucUrl = menuItemName + ".ascx";

 

 

UserControl uc = null;

 

 

try

 

{

uc =

this.LoadControl(ucUrl) as UserControl;

 

 

if (uc != null)

 

{

ContentPlaceholder.Controls.Add(uc);

TrackedUserControl = ucUrl;

}

}

 

catch (Exception ex)

 

{

 

string msg = ex.Message;

 

}

}

 

private void ReloadContent()

 

{

 

UserControl uc = null;

 

 

try

 

{

uc =

this.LoadControl(TrackedUserControl) as UserControl;

 

}

 

catch

 

{

}

 

if (uc != null)

 

ContentPlaceholder.Controls.Add(uc);

}

 

private bool IsPostingFromMenu()

 

{

 

string ctlPostingBack = ScriptManager.GetCurrent(this).AsyncPostBackSourceElementID;

 

 

Control c = this.FindControl(ctlPostingBack);

 

 

if (c == null)

 

 

return false;

 

 

return (c.ID == "PanelNavigation");

 

}


thx

saroja
Top achievements
Rank 1
 asked on 27 Aug 2009
2 answers
330 views
Hi!

I have a main form containing MDI forms.
When I load my MDI form (containing a multi column drop down control), I want the drop down control to have focus so I can start writing in it without first having to selected it.
(Im using a multi drop down control as a search input field)

Can this be done ?

Regards
Per
Per
Top achievements
Rank 1
 answered on 27 Aug 2009
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?