Telerik Forums
UI for WinForms Forum
3 answers
401 views
Dear All,

I have two RadGridView in WindowsForms namely radGridView1 and radGridView2.
 
I have data in radGridView1 and also i need to drag and drop radGridView1 row to radGridView2 wise single row and multi row.

And also no data in radGridView2.

My coding are mentioned below.

private void Form1_Load(object sender, EventArgs e)
       {
           DataTable dt = new DataTable();
           dt = c.getdata();
           radGridView1.DataSource = dt;
       }
public DataTable getdata()
       {
           con.Open();
           cmd = new SqlCommand("select * from employee", con);
           sda = new SqlDataAdapter(cmd);
           sda.Fill(dt);
 
           con.Close();
           return dt;
       }


How to implement this?

Thanks in Advance..!

Svett
Telerik team
 answered on 25 Jan 2013
4 answers
345 views
Hi -

 How can I make the width of my drop down be the width of the largest row in the drop down?

 Thanks,
Anton
Telerik team
 answered on 25 Jan 2013
3 answers
123 views
Hello Sir,

We have bought Telerik License and we are using Telerik product from a long period of time. Now we want to update our Telerik License so that we are able to use updated version of Telerik with updated controls.But we are facing some problems with the Latest verion. As we are using Trial version of Telerik and while using it we have found that it is being clashed with its previous version. 
Issue is that when we upgrade Latest verion of Telerik with the Previous version, it replaces Previous version completely(replaces old DLL with new DLL in same folder) and because of which a lot of problems occurs with the previous controls of Telerik. As Our Software is divided into multiple Exe files and we are using Telerik dll in these files and these are being used in multiple places and we do not want to compile all exe's again with new version. so we are not able to update our License because of the problems with some controls in previous version's exe. Please provide us the solution of this problem so that we can update our Telerik License and using it our Software will run without any problem.

Thank you
Biliana Ficheva
Telerik team
 answered on 25 Jan 2013
2 answers
310 views
Hi, :)

I use a radgridview inside my application where certain words inside of cells should be marked. At the moment I solved this via DisableHTMLRendering and manipulating the data displayed in the cells... for instance with 
cellInfo.Value = "<html>" + cellInfo.Value.ToString() + "</html>";
foreach (KeyValuePair<String, Color> kvp in this._highlightWords)
{
    cellInfo.Value = Regex.Replace(cellInfo.Value.ToString(), kvp.Key, "<span style=" + '"' + "background-color:" + System.Drawing.ColorTranslator.ToHtml(kvp.Value) + '"' + ">" + kvp.Key + "</span>", RegexOptions.IgnoreCase);
    string[] tmpString = Regex.Split(cellInfo.Value.ToString(), kvp.Key, RegexOptions.IgnoreCase);
}

I have a list of words to be marked and I want them to have a colored background... depending on the current word.

Works fine so far, but I do have problems with the encoding. Special characters, like "ä", "ö" are not displayed properly... is there any way to set the encoding?

I already tried to hard-convert my content to utf-8, but that didn't change anything.

byte[] utf8String = Encoding.UTF8.GetBytes(cellInfo.Value.ToString());
cellInfo.Value = Encoding.UTF8.GetString(utf8String);

The data is received from a SQLCE database... am I doing something wrong? Or is this only solvable via the webbrowsercolumns you mentioned in another thread? Will those webbrowsercolumns still be performant, if I do have thousands of them? :)

Thanks in advance!
Kind Regards
Fabian
RAG
Top achievements
Rank 1
 answered on 25 Jan 2013
1 answer
254 views

I am currently create an web application to load the selected order in the client transaction record by clicking the copy button in the RadGrid. I implement this by getting the id of the order and retrieve the required entity to insert the form.

JS Runtime Error That Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object By using MVVM Model , I preset the blank row to be null in terms of the mapped fields such as consumer ID , order ID , consumer Name , Price and so on .

The Order Reference Id is named as referenceOrder and retrieve the LoadReference to insert the record

I am currently using C# , Visual Studio 2012.

What I want to ask is there any methodology to check if the row is blank before the copy action being executed ?

The below is my code



 protected void grdCustomerReport_ItemCommand(object sender, GridCommandEventArgs e)
    {
        // [Start] Declare Grid and GridData.
        RadGrid CurrentGrid = (RadGrid)sender;
        GridDataCustomerReport GridSource = PageSource.GrdCustomerReport;
        //[End] 
        if (e.CommandName == "CustomInsert" &&
            GridSource.state != GridModelState.Edit)
        {
           //Add blank row
        }
        else if (e.CommandName == "DeleteCurrent")
        {
          //Delete Row
            CurrentGrid.Rebind();
        }
        else if (e.CommandName == "Copy") <--I click the button and retrieve the dataset index 
        {
            //Check if there is empty row  ? 

            int referenceOrder ;
            int rowIndex = Convert.ToInt32(e.CommandArgument);

            RadComboBox cbo= (RadComboBox) CurrentGrid.Items[rowIndex].FindControl("cboCode");
            if (cbo.SelectedIndex > 0  && cbo.SelectedValue != "")
            {
                referenceOrder = Convert.ToInt32(cbo.SelectedValue);
                PageSource.SetOrder(referenceOrder );
                LoadReference();
            }
            else
            {
               winAlert.RadAlert("<b>" + "Please Select Reference Orderin the Dropdown List" + "</b>.<br />", 330, 100, "", null);
            }
        }
    }
Angel Petrov
Telerik team
 answered on 25 Jan 2013
1 answer
231 views
Hi,

When users need to select from a large list a dropdownlist is arguably not necessarily the best solution. However using teleriks "SuggestAppend" option it is a user friendly option. I'm faced with a patient list which potentially has a few thousand names. Instead of binding the full list, I'd like to bind a subset based on the users input: load on demand.

So far I managed to get things working. The dropdownlist is populated when the user inputs at least 3 characters. I also enabled "SuggestAppend" on the control. I'm using the Key_Up event like this:
/// <summary>
/// Load on demand drop down list
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks></remarks>
private void ddlPatient_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
    //Datasource only changes when user hits a letter
    //OrElse e.KeyCode = Keys.Return Then
    if ((e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z)) {
        //and we have atleast 3 characters
        if (ddlPatient.Text.Length > 2) {
            //suspend any further keyboard input, untill we're done
            ddlPatient.KeyDown += SuspendKeyboard;
            string txt = ddlPatient.Text;
            //update de dropdown datasource based on the user input (from Open Access model)
            ddlPatient.DataSource = _context.Patients
                  .Where(c => c.Naam.StartsWith(txt) || c.GetrouwdeNaam.StartsWith(txt))
                            .OrderBy(c => c.Naam)
                                                 .ThenByDescending(c => c.GeboorteDatum)
                                 .Take(100);
            //This should be done when initializing the form
            //ddlPatient.DisplayMember = "InfoZoekPatient"
            //ddlPatient.ValueMember = "PatientID"
            //restore the user input and place the cursor at the and of the text
            ddlPatient.Text = txt;
            ddlPatient.SelectionStart = txt.Length;
            //restore keyboard input
            ddlPatient.KeyDown -= SuspendKeyboard;
        }
        e.Handled = true;
        e.SuppressKeyPress = true;
    }  
}
 
/// <summary>
/// Catch any keyboard input and ignore it!
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks></remarks>
private void SuspendKeyboard(object sender, KeyEventArgs e)
{
    e.Handled = true;
    e.SuppressKeyPress = true;
}

The problem is that the selected value of the dropdownlist does not necessarily reflect the user selection? Somehow it gets the value of the first item of the renewed datasource. I've fixed this with the leave event:

/// <summary>
/// When a patient was not selected, but the user enter a search string we need to clean up.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks></remarks>
private void ddlPatient_Leave(object sender, System.EventArgs e)
{
    RadDropDownList ddl = sender;
    bool clear = true;
    //check if the selected item valuemember equals the ddl text.
    if (ddl.SelectedItem != null) {
        Patient pat = ddl.SelectedItem.DataBoundItem;
        if (pat != null) {
            if (ddl.Text.Trim == pat.InfoZoekPatient.Trim)
                clear = false;
        }
    }
 
    if (clear) {
        ddl.SelectedIndex = -1;
        ddl.Text = string.Empty;
        ddl.SelectedItem = null;
        ddl.Update();
    }
 
}

Now, it works but it seems like a lot of code compared to the ASP.Net control...
Is there an easier way to do this?

Regards,
Raoul
Missing User
 answered on 24 Jan 2013
1 answer
107 views
Hi,Telerik

     My  RadTreeView is customize . And RadTreeView associated with  RadTreeView .Now,I want  to Click RadContextMenu's  "Add Node"  enevt  at  the end of RadTreeView 's nodes  add  an node. Please let me konw how to do.
 

Thanks very much.
Plamen
Telerik team
 answered on 24 Jan 2013
4 answers
229 views
Hello,

I have some trouble with RadMaskedEditBox using Numeric Masks.
When I use a standard Numeric Mask like "c2" or "N", it's working.
When I try to use any Custom Numeric Mask like "#,##.00 'CHF'" or a simple "0" I'm getting in trouble (can't type anything in the maskedbox !).

My final purpose is to have a mask for Swiss Currency typing (independant of culture, so I can't use the standard currency).
Some examples: "120.00 CHF", "1'420.15 CHF".

I actually use a workaround with the "N2" mask and a label for my "CHF".

Thanks
Missing User
 answered on 24 Jan 2013
4 answers
263 views
Hi,

I started trying your RadControls specifically for the use of the GridView hierarchy, but lately have noticed a lot of complications when trying to make the transition from regular DataGridView to RadGridView. One such example:

I have a RadGridView bound to a table on a SQL Server database. Retrieving the information is fine, however, I want to make some cells hyperlinks. Previously, I would write something like this to change my cells from regular TextBoxCells to HyperlinkCells after the binding completed:

for each (Windows::Forms::DataGridViewColumn^ column in dgv->Columns)
{
    if(column->HeaderText == "Something"))
    {                      
        for each (DataGridViewRow^ row in dgv->Rows)
        {
            row->Cells[column->Index] = gcnew DataGridViewLinkCell();
        }
    }
}

But I notice there isn't any GridViewHyperlinkCell class or anything similar. How would I go about replicating this behavior? The entire column can be HyperLinkCells. I understand that you can make the entire column of type GridViewHyperLinkColumn, but how would I achieve this dynamically?


EDIT: To accomplish the functionality I described above, I did the following:
  • Set the GridView property "AutoGenerateColumns" to False
  • Manually added columns w/ desired column type and set the "FieldName" property to the corresponding column header name in my database table. This directly reflected the table structure in my database.
  • Set the GridView's "DataSource" to the bindingSource I use to retrieve the table from the database.

This takes the ease out of setting and forgetting, but I couldn't figure out an alternate way.

Julian Benkov
Telerik team
 answered on 24 Jan 2013
1 answer
111 views
Hi, after a couple of years absence i'm evaluating the Radscheduler again. Despite of the help of this forum i cannot get a situation working. Very important to get it done on time, because a customer expects a demo.

what is the situation?
In fact perfect described by this post:-
http://www.telerik.com/community/forums/winforms/scheduler/currently-selected-appointment.aspx

i added an Id as a property.

My question: how to get the id of the changed appointment?

thanks for your help!

Best regards.
Aat Jan
Ivan Todorov
Telerik team
 answered on 24 Jan 2013
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?