Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
122 views
you can create a combobox columns with header but load the data with a webservice?

I load the record in combobox with this code:


<WebMethod()> _
Public Function GetLuogoNome(ByVal context As RadComboBoxContext) As RadComboBoxData
    Dim data As DataTable = GetCittadinanza(context.Text)
 
    Dim comboData As New RadComboBoxData()
    Dim itemOffset As Integer = context.NumberOfItems
    Dim endOffset As Integer = Math.Min(itemOffset + ItemsTipoGruppoPerRequest, data.Rows.Count)
    comboData.EndOfItems = endOffset = data.Rows.Count
 
    Dim result As New List(Of RadComboBoxItemData)(endOffset - itemOffset)
 
    For i As Integer = itemOffset To endOffset - 1
        Dim itemData As New RadComboBoxItemData()
        itemData.Text = data.Rows(i)("descrizione").ToString()
        itemData.Value = data.Rows(i)("idrecord").ToString()
        result.Add(itemData)
    Next
    REM ottengo il messaggio dei record selezionati
    comboData.Message = GetStatusMessage(endOffset, data.Rows.Count)
    comboData.Items = result.ToArray()
    Return comboData
End Function
Private Function GetLuogo(ByVal text As String) As DataTable
    REM SELECT * FROM Tab_categorie WHERE CONTAINS(descrizione, @text)
    REM per indici full text
    Dim conString = ConfigurationManager.ConnectionStrings("Receptionstring")
    Dim strConnString As String = conString.ConnectionString
    Using scope As New Transactions.TransactionScope
        Using db As New SqlConnection(strConnString)
            db.Open()
            Using sqlcmd As New SqlCommand("get_cittadinanza", db)
                sqlcmd.CommandType = CommandType.StoredProcedure
                sqlcmd.Parameters.AddWithValue("@textsearch", SqlDbType.VarChar).Value = text
                Dim adapter As New SqlDataAdapter(sqlcmd)
                Dim data As New DataTable()
                adapter.Fill(data)
                Return data
            End Using
        End Using
        scope.Complete()
    End Using
Hristo Valyavicharski
Telerik team
 answered on 05 Jul 2013
1 answer
235 views
  Below is the gridview rowcommand code which i want to convert in radgrid itemdatabound any budy have solution

protected void Gridviiew_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.Header)
                {
                    dtTotalDuration = Convert.ToDateTime("01/01/1900");
                    dtTotalTimeSpent = Convert.ToDateTime("01/01/1900");
                }
                else if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Int32 intRow = e.Row.RowIndex + 1;

                    int intSeconds;
                    string strValue;
                    string strHtml;

                    //strHtml = "javascript:var w=window.showModalDialog('Course.aspx?ChapterNum=" + intRow.ToString() + "', null, 'dialogHeight=700px; dialogTop=75px; dialogLeft=250px; dialogWidth=800px; edge=Raised; center=No; help=Yes; resizable=no; status=no; scroll=yes');";
                    strHtml = "javascript:var w=openCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
                     //   e.Row.Cells[4].Attributes.Add("OnClientClick", "function_Name()");

                    //Add New
                    string strhtmlnew1 = "javascript:RadWindowOpenCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
                    e.Row.Cells[4].Attributes.Add("OnClick", "javascript:RadWindowOpenCourse('" + intRow.ToString() + "','" + Session["CID"] + "');return false;");
                   
                    strValue = DataBinder.Eval(e.Row.DataItem, "Course_Duration").ToString();
                    intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
                    dtTotalDuration = dtTotalDuration.AddSeconds(Convert.ToDouble(intSeconds));

                    strValue = DataBinder.Eval(e.Row.DataItem, "Customer_Duration").ToString();
                    intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
                    dtTotalTimeSpent = dtTotalTimeSpent.AddSeconds(Convert.ToDouble(intSeconds));
                }
                else if (e.Row.RowType == DataControlRowType.Footer)
                {
                    e.Row.Cells[1].Text = dtTotalDuration.ToString("HH:mm:ss");
                    e.Row.Cells[2].Text = dtTotalTimeSpent.ToString("HH:mm:ss");
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Substring(0, 56) != "Specified argument was out of the range of valid values.")
                {
                    clsErrorLogData.LogError("Content", "Gridviiew_RowDataBound", ex.Source + "_" + Common_App.MyString(Session["CID"]), ex.Message, "");
                }
            }
        }
Princy
Top achievements
Rank 2
 answered on 05 Jul 2013
1 answer
72 views
is it possible to loop thru the "stand alone" radFilter and get the FieldNames + any Vaule used rather than have a huge GLOB of text to Parse thru?
i've been using RadFilters for over three years and don't really need a link to a tutorial unless it specifically shows this function. i was wondering if it's even possible.
usually i wind up w/ this to deal with:
 WHERE  (WORKORDERNUMBER LIKE '12345%' AND TRUNC(INVOICEDATE) >= TO_DATE('7/1/2013 12:00:00 AM','MM/DD/YYYY HH12:MI:SS AM') AND PROFITCENTERCODE LIKE '0708%')

this is great for tacking onto a dynamic query - but, i'd like to be able to capture which field was used and what value was passed.
thx
rik


 

 

<telerik:RadFilter ID="VolSummaryRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true" OnFieldEditorCreating="VolSummaryRadFilter_FieldEditorCreating"

 

 

 

OnPreRender="VolSummaryRadFilter_PreRender" OnApplyExpressions="VolSummaryRadFilter_Apply" Visible="false" OnItemCommand="VolSummaryRadFilter_ItemCommand">

 

 

 

<FieldEditors>

 

 

 

 

<telerik:RadFilterDateFieldEditor FieldName="INVOICEDATE" DisplayName="Invoice Date"

 

 

 

DataType="System.DateTime" MinDate="1/1/1900" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="PROFITCENTERCODE" DisplayName="Profit Ctr Code"

 

 

 

 

 

 

 

DataType="System.String" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="WorkOrder #" DataType="System.String" />

 

 

 

</FieldEditors>

 

 

 

</telerik:RadFilter>

 

Kostadin
Telerik team
 answered on 05 Jul 2013
3 answers
246 views
Hi,
i am new to telerik controls.i used RAD Progress Area control in my project.if i use it with out update panel,it works as expected.when i place it with in update panel the progress area is not closing even after the process is over.i add RadProgressContext.OperationComplete = true;.
but no luck.how to do this.
Thanks.
Shinu
Top achievements
Rank 2
 answered on 05 Jul 2013
5 answers
197 views

When using radfilter in radwindow like the following example, This radwindow/radfilter is shared my all the gird filter through my site.

http://demos.telerik.com/aspnet-ajax/filter/examples/filterinradwindow/defaultcs.aspx

If I have GridDateTimeColumn on the grid and have TimePicker and DatePicker as PickerType for separate column, On the filter, how can I check the GridDateTimeColumn PickerType to show date only (no time icon) when PickerType is DatePicker and show time only ( no date icon) when PickerType is TimePicker ?

Thanks

Antonio Stoilkov
Telerik team
 answered on 05 Jul 2013
11 answers
209 views
RadTimePicker pop Window is not working with Google Chrome & Apple Safari  .
Though it is working fine with IE & Mozilla Firefox.  
Daniel
Telerik team
 answered on 05 Jul 2013
1 answer
107 views
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WeBOC.DAL.Vessel>" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<script runat="server">
 
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = ViewData["Vessels"];               
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <form id="form2">
     
 
    <h2>Vessels<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
    </h2>
     
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
        CellSpacing="0" GridLines="None" Skin="WebBlue"
        onneeddatasource="RadGrid1_NeedDataSource" AllowPaging="True"  PagerStyle-Mode="NextPrevNumericAndAdvanced">
        <MasterTableView>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="VIR_NO" HeaderText="VIR No." />
                <telerik:GridBoundColumn DataField="INBOUND_VOY_NO" HeaderText="I/B Voyage" />
                <telerik:GridBoundColumn DataField="OUTBOUND_VOY_NO" HeaderText="O/B Voyage" />
                <telerik:GridBoundColumn DataField="VESSEL_NAME" HeaderText="Vessel Name" />
                <telerik:GridBoundColumn DataField="ARRIVAL_DATE" HeaderText="Arrived" />
                <telerik:GridBoundColumn DataField="STATE" HeaderText="Phase" />               
                <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column"
                    UniqueName="TemplateColumn">
                    <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" Text="View"
                            NavigateUrl='<%#Url.Action("Inspector","Vessel",new{id=Modal.VSSL_CALL_ID}) %>'></asp:HyperLink>
                        </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
        </MasterTableView>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
    </telerik:RadGrid>
 
     
    </form>
 
</asp:Content>


Have a look at the above code, when it runs, it stuck at  NavigateUrl='<%#Url.Action("Inspector","Vessel",new{id=Modal.VSSL_CALL_ID}) %>'>

and says that object reference not set to an instance of an object. How do i achieve the functionality that when i click on this hyperlink, the id of the selected row will pass to the desired controller?

Thanks
Ovais
Andrey
Telerik team
 answered on 05 Jul 2013
6 answers
147 views
hey - i have a custom filter for combox in a telerik filter  that i'd like to be typeable.
it's built in to the other radComboboxes:
can you suggest anything that i could use to make this possible - below is part of that initialize of the class:
i tried using [comboBox.EnableLoadOnDemand = true;] - but i dont know how to refernce the Object DataSouce to pick what's being typed in the filter ComboBox.
mark up is included:

 

 

<telerik:RadFilter ID="InventoriesRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"

 

 

 

OnPreRender="InventoriesRadFilter_PreRender" OnApplyExpressions="InventoriesRadFilter_Apply"

 

 

 

ApplyButtonText="Filter Inventory" OnFieldEditorCreating="RadFilter_FieldEditorCreating" OnItemCommand="InventoriesRadFilter_ItemCommand">

 

 

 

<FieldEditors>

 

 

 

<goldcustom:RadFilterComboBoxEditor DataSourceID="GetCustInvODS" FieldName="OWNER_COMPANYNAME" DisplayName="Owner Name" ComboBoxSkin="WebBlue" ComboBoxWidth="350px"

 

 

 

DataType="System.String" />

 

 

 

</FieldEditors>

 

 

 

</telerik:RadFilter>

 

THE ODS [need somehow to get what's typed in the RadFilterComboBoxEditor above

 

 

public DataTable getCustForInventory()

 

{

 

 

DataTable dt = new DataTable();

 

 

 

int[] myLoc = DivisionIDArray;

 

 

 

using (InventoryBC ibc = new InventoryBC())

 

{

dt = ibc.GetCustomerForInventory(myLoc,

 

"" );

 

 

 

return dt;

 

}

}




THE CLASS:

 

 

public override void InitializeEditor(Control container)

 

{

comboBox =

 

new RadComboBox();

 

comboBox.ID =

 

"ComboBoxEditor" + FieldName;

 

comboBox.DataSourceID = DataSourceID;

comboBox.OnClientSelectedIndexChanged =

 

"clientSelectedIndexChanged";//changes focus to the default button of the page

 

comboBox.OnClientLoad =

 

"clientSelectedIndexChanged";//changes focus to the default button of the page so, 1st item in the list can be selected

 

comboBox.DataTextField = (

 

String.IsNullOrEmpty(DataTextField)) ? FieldName : DataTextField;

 

comboBox.DataValueField = (

 

String.IsNullOrEmpty(DataValueField)) ? FieldName : DataValueField;

 

comboBox.Skin = ComboBoxSkin;

comboBox.Width = ComboBoxWidth;

container.Controls.Add(comboBox);

}

Antonio Stoilkov
Telerik team
 answered on 05 Jul 2013
1 answer
93 views
I'm currently working with a number of RadCharts and a RadGrid. When a RadChart is clicked I switch its skin from black to deep red to show that it has been selected. This functionality works just fine. When one of the other charts is clicked a message is broadcast to all other charts to change their skin back to black if they were deep red. The line of code is called and the variable RadChart1.Skin is set to black, but the appearance of the chart maintains the deep red skin. If I set "SkinsOverrideStyles" to true the chart does change correctly, but it changes my legend back to SeriesName rather than ItemLabels (as well as changing a few other things I have set) so that solution doesn't seem plausible. Is there any reason why the chart would only correctly change skins once? As I previously stated even with SkinsOverrideStyles set to false it makes the change from Black to Deep Red without any problems, the issue is when I try to switch back from Deep Red to Black.
Nikolay
Telerik team
 answered on 05 Jul 2013
8 answers
519 views
I have a RadGrid that is residing on a small RadWindow.  I want to disable/disallow the Page Size dropdown option on the grid interface.  How can this be done?  Thanks for any help in advance.
he
Top achievements
Rank 1
 answered on 05 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?