Telerik Forums
UI for WinForms Forum
1 answer
210 views
Hi,
my gridview has a self-reference relation its first column holds '+' sign to expand a row. when i expand a row the first cell's content
shows it's whole text after expand current row and going to next row, the first cell of the new row's content appears ellipsed and i must resize the first column again to see whole contents of the cell, any ideas to solve this?
thanks.
Svett
Telerik team
 answered on 25 May 2011
3 answers
122 views
Hi,
I want to select data from radgrid (see picture "selectdata.jpg") after that it will bind to MultiColumComboBox (see picture "multicolumcombobox.jpg") but it not work.

My code here
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
    function UpdateItemCountField(sender, args) {
        //set the footer text
        sender.get_dropDownElement().lastChild.innerHTML = "A total of " + sender.get_items().get_count() + " items";
    }
</script>
  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid2_Search">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel_Search_New" />
                <telerik:AjaxUpdatedControl ControlID="RadGrid2_Search" />
                <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel_Footer" />
                <telerik:AjaxUpdatedControl ControlID="txtPrdtOrderNo" />
                <telerik:AjaxUpdatedControl ControlID="RadComboBox_Plan" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Skin="WebBlue" />
  
<table cellspacing="10" width="100%">
    <tr>
        <td class="style20"></td
        <td class="styleLbl">PrdtOrderNo: </td>
        <td class="styleTxtBox">
            <asp:TextBox ID="txtPrdtOrderNo" runat="server" Width="150px" Visible="false" ></asp:TextBox>
        </td>
        <td>
            <telerik:RadAjaxPanel ID="RadAjaxPanel_Search_New" runat="server">
                <asp:Button ID="btnSearch" runat="server" Text="¤é¹ËÒ" Width="100px" />  
                <asp:Button ID="btnNew" runat="server" Text="New" Width="100px" />
            </telerik:RadAjaxPanel>
        </td>
    </tr>
    <tr>
        <td class="style20"></td>  
        <td class="styleLbl">Plan : </td>
        <td class="styleTxtBox">
            <telerik:RadComboBox runat="server" ID="RadComboBox_Plan" Height="150px"
                Width="200px" MarkFirstMatch="true" DataSourceID="SqlDataSource_Plan" 
                DataValueField="planNo"
                EnableLoadOnDemand="true"
                HighlightTemplatedItems="true" AppendDataBoundItems="true"
                OnClientItemsRequested="UpdateItemCountField"
                OnDataBound="RadComboBox_Plan_DataBound"
                OnItemDataBound="RadComboBox_Plan_ItemDataBound"
                OnItemsRequested="RadComboBox_Plan_ItemsRequested" Skin="WebBlue">
                <Items>
                    <telerik:RadComboBoxItem Text="--Please Select--" Value="" Selected="true"/>     
                </Items>
                <HeaderTemplate>
                    <ul>
                        <li class="col1">Plan No</li>
                        <li class="col2">Plan Date</li>
                    </ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <ul>
                        <li class="col1">
                            <%#DataBinder.Eval(Container.DataItem, "planNo")%></li>
                        <li class="col2">
                            <%#DataBinder.Eval(Container.DataItem, "date", "{0:dd/MM/yyyy}")%></li>
                    </ul>
                </ItemTemplate>
                <FooterTemplate>
                    A total of
                    <asp:Literal runat="server" ID="RadComboItemsCount" />
                    items
                </FooterTemplate>
            </telerik:RadComboBox>  
            <asp:SqlDataSource ID="SqlDataSource_Plan" runat="server" 
                ConnectionString="<%$ ConnectionStrings:projectConnectionString %>" 
                SelectCommand="SELECT planNo, date FROM [Plan] ORDER BY date">
            </asp:SqlDataSource>
        </td>
        <td>
            <asp:RequiredFieldValidator runat="server" 
                    ID="ReqFieldValidate_ddlPlan" ControlToValidate="RadComboBox_Plan"
                    ErrorMessage="*" ValidationGroup="ForSave" Display="Dynamic"
                    InitialValue="--Please Select--" />   
        </td>
    </tr>
</table>
  
  
<table cellspacing="10" width="100%">    
    <tr>
        <td class="style20"></td
        <td colspan="2">
            <telerik:RadGrid ID="RadGrid2_Search" runat="server" 
                    AllowAutomaticDeletes="True"
                    AllowAutomaticUpdates="True" DataSourceID="SqlDataSource2_Search"
                    AllowAutomaticInserts="True"  
                    AutoGenerateColumns="False"  
                    GridLines="None" Width="100%" Skin="WebBlue">
                <ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
                <MasterTableView DataKeyNames="prdtOrderNo, planNo, planDate, date, productNo, productName, qtyPrdtOrder, qtyProduce, status, remark" 
                        DataSourceID="SqlDataSource2_Search"
                        NoMasterRecordsText="No records to display."
                        AutoGenerateColumns="false" Name="ProductionOrder_Search">
                    <Columns>
                        <telerik:GridBoundColumn DataField="prdtOrderNo" DefaultInsertValue="" 
                            HeaderText="prdtOrderNo" SortExpression="prdtOrderNo" 
                            UniqueName="prdtOrderNo" ReadOnly="True" Display="false">
                        </telerik:GridBoundColumn>                   
                        <telerik:GridBoundColumn DataField="planNo" DefaultInsertValue="" 
                            HeaderText="planNo" SortExpression="planNo" 
                            UniqueName="planNo" ReadOnly="True">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="planDate" DefaultInsertValue="" 
                            HeaderText="planDate" SortExpression="planDate" UniqueName="planDate"
                            DataFormatString="{0:dd/MM/yyyy}">
                        </telerik:GridBoundColumn>                        
                        <telerik:GridBoundColumn DataField="date" DefaultInsertValue="" 
                            HeaderText="date" SortExpression="date" UniqueName="date"
                            DataFormatString="{0:dd/MM/yyyy}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="productName" DefaultInsertValue="" 
                            HeaderText="productName" SortExpression="productName" UniqueName="productName">
                        </telerik:GridBoundColumn>                        
                        <telerik:GridBoundColumn DataField="qtyPrdtOrder" DefaultInsertValue="" 
                            HeaderText="qtyPrdtOrder" SortExpression="qtyPrdtOrder" UniqueName="qtyPrdtOrder" 
                            ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="qtyProduce" DefaultInsertValue="" 
                            HeaderText="qtyProduce" SortExpression="qtyProduce" UniqueName="qtyProduce"
                            ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="status" DefaultInsertValue="" 
                            HeaderText="status" SortExpression="status" UniqueName="status">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="remark" DefaultInsertValue="" 
                            HeaderText="remark" SortExpression="remark" UniqueName="remark" Visible="false">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <asp:SqlDataSource ID="SqlDataSource2_Search" runat="server" 
                ConnectionString="<%$ ConnectionStrings:projectConnectionString %>" 
                SelectCommand="SELECT ProductionOrder.prdtOrderNo, ProductionOrder.planNo, [Plan].date AS planDate, ProductionOrder.date, ProductionOrder.productNo, Product.productName, [Plan].qtyPlan, ProductionOrder.qtyPrdtOrder, ProductionOrder.qtyProduce, ProductionOrder.status, ProductionOrder.remark FROM [Plan] INNER JOIN Product ON [Plan].productNo = Product.productNo INNER JOIN ProductionOrder ON [Plan].planNo = ProductionOrder.planNo">
            </asp:SqlDataSource>
        </td>
    </tr>
</table>
  
<center>
    <telerik:RadAjaxPanel ID="RadAjaxPanel_Footer" runat="server">    
        <asp:Button ID="btnSave" runat="server" Text="Save" Width="100px" ValidationGroup="ForSave" />  
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="100px"/>
    </telerik:RadAjaxPanel>
</center>
  
<asp:SqlDataSource ID="SqlDataSource_ddlProduct" runat="server" 
        ConnectionString="<%$ ConnectionStrings:projectConnectionString %>" 
        SelectCommand="SELECT productNo, productName FROM Product WHERE status = 'Active'">
</asp:SqlDataSource>
  
</asp:Content>

Protected Sub RadComboBox_Plan_DataBound(ByVal sender As Object, ByVal e As EventArgs)
    'set the initial footer label
    CType(RadComboBox_Plan.Footer.FindControl("RadComboItemsCount"), Literal).Text = Convert.ToString(RadComboBox_Plan.Items.Count)
End Sub
Protected Sub RadComboBox_Plan_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
    SqlDataSource_Plan.SelectCommand = "SELECT planNo, date FROM [Plan] ORDER BY date"
    RadComboBox_Plan.DataBind()
End Sub
Protected Sub RadComboBox_Plan_ItemDataBound(ByVal sender As Object, ByVal e As RadComboBoxItemEventArgs)
    'set the Text and Value property of every item
    'here you can set any other properties like Enabled, ToolTip, Visible, etc.
    e.Item.Text = Convert.ToDateTime(DirectCast(e.Item.DataItem, DataRowView)("date").ToString()).ToString("dd/MM/yyyy")
    e.Item.Value = (DirectCast(e.Item.DataItem, DataRowView))("planNo").ToString()
End Sub
Private Sub RadGrid2_Search_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid2_Search.SelectedIndexChanged
    '''' set header
    txtPrdtOrderNo.Text = RadGrid2_Search.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid2_Search.SelectedItems(0).ItemIndex)("prdtOrderNo")
    RadComboBox_Plan.SelectedValue = RadGrid2_Search.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid2_Search.SelectedItems(0).ItemIndex)("planNo")
End Sub

Thanks

Vasil
Telerik team
 answered on 25 May 2011
1 answer
123 views
Hi,

                 I am using radscheduler ,i want to know the properties it has a property activeviewtype =day,week,timeline

for janus i am using like this for workweek to be shown

scheduler1.View = Janus.Windows.Schedule.

 

ScheduleView.WorkWeek;


foe telerik radscheduler how can i write please can anyone tell me regarding this i tried by using
radscheduler1.ActiveViewType property but couldnt do it


Thanks
Divya

 

Stefan
Telerik team
 answered on 25 May 2011
4 answers
126 views
Hi, In the ItemDataBound event i use the following code to change the height of the items:
args.NewItem.Height = 35

But with filtered items the height gets reset.
I've searched over the internet for an event or property
but couldn't find how to keep the height unchanged.
Please help.
Thank you.
Peter
Telerik team
 answered on 25 May 2011
7 answers
177 views
I'm using a DateTimePicker for time entry by setting Format = Custom and CustomFormat = "h:mm tt"  (ex, 12:34 PM) This is working fine as long as I have a value assigned.

Sometimes I don't have a value for this field and would like to display the NullText.  When working with dates, I call SetToNullValue() and the NullText is displayed.  However, with the way I've set up the picker for times, the NullText is not displayed and I'm left with an empty data entry text box.  This also happens when Format = Time, so I think the issue is related to not displaying the date, rather than what the time format is.

Is there a way to use the CustomFormat mentioned above and also get the NullText to display after SetToNullValue() is called?  I don't care what the date value is and only need resolution of minutes, so tricks involving setting the date or time to special values are probably ok.

Thanks,
DaveL
Stefan
Telerik team
 answered on 25 May 2011
2 answers
78 views
Good morning


i have the next doubt....i have a grid with information and i need that the end-user can copy the information that it containt but i run the application and i see the information in the grid i use click-right -> copy after that i am going to paste in for exaple excel or notepad but it doesn't work.. its possible ..

Thanks for your information..
Emilio
Stefan
Telerik team
 answered on 25 May 2011
1 answer
133 views
How to set a static size to my Resources  in Scheduler.
see pic.
Ivan Todorov
Telerik team
 answered on 25 May 2011
1 answer
78 views
How can i remove the scroll bars?
see pic. attached.
Ivan Todorov
Telerik team
 answered on 25 May 2011
6 answers
924 views
Hi,

I am looking for an easy way to let the user select and copy/paste text from a readonly textboxcolumn in a grid. How can this be achieved?

Best regards,
Diederik.
Jack
Telerik team
 answered on 25 May 2011
1 answer
80 views
Hello,

Assuming I have a two levels hierarchical grid that is build dinamically where I don't know the number of the child grids and where the master template is different respect to the child template.

In order to export to pdf a gridview that contains child gridviews (hierarchical grid) I create an ExportToPDF object:

ExportToPDF exporter = new ExportToPDF(radGridView1);
exporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
exporter.SummariesExportOption = SummariesOption.ExportAll;
exporter.FitToPageWidth = false;
exporter.Scale = 1;
exporter.FileExtension = "pdf";
exporter.TableBorderThickness = 1;
exporter.PdfExportSettings.EnableCopy = true;
exporter.HTMLCellFormatting += new Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventHandler(exporter_HTMLCellFormatting);
exporter.ExportVisualSettings = true;
exporter.ExportHierarchy = true;
exporter.PdfExportSettings.FontType = Telerik.Apoc.Render.Pdf.FontType.Embed;

I need to format the cell value in the case it is type Decimal so I have added a new handle for the HTMLCellFormatting event:

void exporter_HTMLCellFormatting(object sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
{
    if (radGridView1.Columns[e.GridColumnIndex].DataType == Type.GetType("System.Decimal"))
    {
     // Some code to manage the format
       //e.HTMLCellElement.Value = string.Format(ecc ecc)
    }
}

In this event handler I need to retrieve the DataType of the current column and this code works perfectly if the current cell e.HTMLCellElement belongs to the master template in the hierarchical order. But when the current cell belongs to a child template it seems there is no way to retrieve the cell's column datatype because there is no way to retrieve what child gridview the cell belongs just starting from the "e" object.

So my question is: is there a way to understand if the indexe.GridColumnIndex refers to the MasterTemplate or if it refers to the Child Template inside the exporter_HTMLCellFormatting ?

Thanks for any aid,
Alcide




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