Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
140 views
Hi,

I have a problem with my RadGrid. I have a simple RadGrid that is bound to a StoreProcedure this SP takes 4 arguments all of them can be null.

I have bound the DataScourse Select to 4 controls (4 textboxes). The thought here is that the user will enter values into the textboxes and then he press a "search" button and the grid shows the data that the SP gets.

An example would be that the user inputs
1 in the 1st box
nothing in the 2nd box
3 in the 3rd box
nothing in the 4th box

In this case I want it to run the SP with the values (1,null,3,null)
This is all very simple and when I test it in the "ConfigureDataSource"-tutorial that the RadGrid has and I test the query it all works great, I do the same inputs leave 2 and 4 with nothing and inputs 1 and 3 in the others.
But when I then try this "live" it doesn't work, the grid doesn't even load up and give no records nothing happends.

The only thing that I can think of since I've been working with SP before is that I can't simply use a empty textbox or a null i need to use a DBNull.value otherwise the SP won't work. So how can I send in DBNull.value to the SP?

I've tried some things like
BoxNumber.Text = DBNull.value
(BoxNumber is the name of one of the textboxes), but it still doesn't work.

The "search" button simply does a

RadGrid1.DataBind();

And since its bound to the controls I would hope that a empty control would give null, but it doesn't. It seems like a very simply and small problem yet I have been stuck with it for a long time now, please help me out.

Thanks in advance.
Radoslav
Telerik team
 answered on 03 Dec 2010
5 answers
160 views
I am creating a RadGrid programmatically. It has 2 template columns as well.
When we click Edit button for a row then, one template column has to be changed to a dropdown and other column should be changed to RadListbox of checkboxes.

Also, the ItemTemplate value should be used to select the appropriate checkboxes ni the RadListBox.

I have written the code to select the ListBoxItems of RadListBox, but it doesn't work. Can some help.

The code I have written is of this way:-


In RadGrid's Item Data Bound event:-

GridDataItem gridDataItem = e.Item as GridDataItem;
            DataRowView dvRow = gridDataItem.DataItem as DataRowView;
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
     {
         GridDataItem gridDataItem = e.Item as GridDataItem;
         DataRowView dvRow = gridDataItem.DataItem as DataRowView;
 
         RadComboBox cmbPositionID = gridDataItem.FindControl("comboPositionID") as RadComboBox;
 
         cmbPositionID.SelectedValue = dvRow["PositionID"].ToString();
 
         RadListBox listBox = gridDataItem.FindControl("comboLanguageID") as RadListBox;
 
         string value = dvRow["LanguageID"].ToString();
 
         string[] values = value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         foreach (string val in values)
         {
             RadListBoxItem item = listBox.FindItemByText(val);
             if (item != null)
                 item.Selected = true;
         }
 
       
     }




lic partial class Default : System.Web.UI.Page
{
    DataTable _userDT = new DataTable();
    DataTable _positionDT = new DataTable();
    DataTable _languageDT = new DataTable();

    RadGrid RadGrid1 = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadGrid1.DataBind(); 
    }

public partial class Default : System.Web.UI.Page
{
    DataTable _userDT = new DataTable();
    DataTable _positionDT = new DataTable();
    DataTable _languageDT = new DataTable();

    RadGrid RadGrid1 = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadGrid1.DataBind();
        }
    }

public partial class Default : System.Web.UI.Page
{
    DataTable _userDT = new DataTable();
    DataTable _positionDT = new DataTable();
    DataTable _languageDT = new DataTable();

  sdfasdfsadf  RadGrid RadGrid1 = null;
public partial class Default : System.Web.UI.Page
{
    DataTable _userDT = new DataTable();
    DataTable _positionDT = new DataTable();
    DataTable _languageDT = new DataTable();

    RadGrid RadGrid1 = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadGrid1.DataBind();
        }
    }
public partial class Default : System.Web.UI.Page
{
    DataTable _userDT = new DataTable();
    DataTable _positionDT = new DataTable();
asdfasdfdsafsa
    RadGrid RadGrid1 = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
  asdf          RadGrid1.DataBind();
        }
    }
    {
        if (!IsPostBack)
        {
 sadfRadGrid1.DataBind();
        }
sdaf
Iana Tsolova
Telerik team
 answered on 03 Dec 2010
3 answers
442 views
Hi,
I went through one problem In radCombobox,I have tables in which I am saving HTML tag text like <I>Test</I>,So when this text binded on RadCombobox then Selected Text display with HTML Tags But I want that I should render HTML automatically and display the text in italic mode,We tried one solutions where we used Itema Templated inside radcombobox its seems to work that time when I Open the combobox that time all html tags get render but when I close combobox then seletedt item display with HTML tags,Please tell me how to solve this?Your help will be highly appreciated.
Kalina
Telerik team
 answered on 03 Dec 2010
1 answer
87 views
Good afternoon,

I have an appointment and I put it on a radScheduler to use  ExportToICalendar method to export it to iCalendar format and I want to select the All day event "Checkbox" on MSOutlook. How I do that? 

Best Regards,

Frederico Fernandes
Peter
Telerik team
 answered on 03 Dec 2010
1 answer
118 views
Greetings,
                  My Scenario is as follows,I have a RadCombobox which contains two items
                            1.Select (value=0)
                             2.Office(value=1)
            On pageload every theing is working fine ie grid is loading when office is selected .The problem is that when combobox item "select" is chosen the grid is again loading.i want to show the grid as null as in the page load.

            According to my point of view the problem is NeedDataSource event is not calling except from PageLoad.

            Pls help me to solve the issue. Here is my code


 private void fill_Grid()
        {
               clsCheckListMaster chklstmaster = new clsCheckListMaster();
                ds = chklstmaster.get_CommodityInInventry(Convert.ToInt32(cmbbxOffice.SelectedValue));
                ViewState["ds"] = ds;
                if (ds.Tables[0].Rows.Count > 0)
                {

                    gdCheckListMaster.DataSource = ViewState["ds"];
                   // gdCheckListMaster.DataBind();
                    
                }
                
                

            
        }

        protected void gdCheckListMaster_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (cmbbxOffice.SelectedIndex > 0)
            {

                fill_Grid();
                gdCheckListMaster.DataSource =ViewState["ds"];

            }
            else
            {
                ViewState["ds"] = null;

            }
            
        }
 protected void gdCheckListMaster_PreRender(object sender, EventArgs e)
        {
            if (cmbbxOffice.SelectedIndex > 0)
            {
                gdCheckListMaster.Rebind();
                clsCheckListMaster chklstmaster = new clsCheckListMaster();

                for (int i = 0; i < gdCheckListMaster.Items.Count; i++)
                {
                    CheckBox chkbxDaily = (CheckBox)gdCheckListMaster.Items[i].FindControl("chkbxDaily");
                    CheckBox chkbxWeekly = (CheckBox)gdCheckListMaster.Items[i].FindControl("chkbxWeekly");
                    CheckBox chkbxYearly = (CheckBox)gdCheckListMaster.Items[i].FindControl("chkbxYearly");
                    DataSet ds1 = chklstmaster.getDetails_ChklstmsterANDRtlcmdtylst();
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        for (int j = 0; j < ds1.Tables[0].Rows.Count; j++)
                        {
                            if (int.Parse(gdCheckListMaster.Items[i][gdCheckListMaster.Columns[0]].Text) == int.Parse(ds1.Tables[0].Rows[j]["INTERNALCOMMODITYID"].ToString()))
                            {
                                if (int.Parse(ds1.Tables[0].Rows[j]["DAILY"].ToString()) == 1)
                                {
                                    chkbxDaily.Checked = true;
                                    chkbxDaily.Enabled = false;
                                }
                                if (int.Parse(ds1.Tables[0].Rows[j]["WEEKLY"].ToString()) == 1)
                                {
                                    chkbxWeekly.Enabled = false;
                                    chkbxWeekly.Checked = true;
                                }
                                if (int.Parse(ds1.Tables[0].Rows[j]["YEARLY"].ToString()) == 1)
                                {
                                    chkbxYearly.Enabled = false;
                                    chkbxYearly.Checked = true;
                                }
                            }
                        }
                    }

                }
            }
            else
            {
                ViewState["ds"] = null;
            }
Princy
Top achievements
Rank 2
 answered on 03 Dec 2010
1 answer
51 views
Hi all, 

I have set my chart by default invisible, on dynamic data binding, I want to make it visible but when it become visible, PlotArea does not match with scale... please see the snapshot below... and help me fixing this problem
Yavor
Telerik team
 answered on 03 Dec 2010
1 answer
200 views
Hi,

I remember that there is a method "SetMaxRequestQueueSize" that we could use to change the queue size of Ajax request.

However, in the latest version (v2010.3.1109.40) of RadAjaxManager,  I could not find this method.

How could I change the Max Ajax queue size with the latest RadAjaxManager?

Ping
Maria Ilieva
Telerik team
 answered on 03 Dec 2010
3 answers
122 views
Looking for expert guidance on how to enable only current date + next 7 days in date picker only.
Only that range is selectable, all other dates disable.

Thanks
Maria Ilieva
Telerik team
 answered on 03 Dec 2010
3 answers
187 views
It 's simple, I only show custom edit form from web user control ( not need to bind data ). Ex: each User, I want to show a picture from picture.acsx when I click on row.
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
    AllowPaging="True" AllowSorting="True"  DataSourceID="ObjectDataSource1"
    GridLines="None" Skin="Black" AllowMultiRowSelection="True"
    onitemcommand="RadGrid1_ItemCommand"
    AutoGenerateEditColumn="True" ShowStatusBar="True"  >
     
<MasterTableView DataSourceID ="ObjectDataSource1" >
<EditFormSettings UserControlName="picture.ascx" EditFormType="WebUserControl">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
</MasterTableView>
    <ClientSettings AllowColumnsReorder="True" EnablePostBackOnRowClick="true">
         
    </ClientSettings>
</telerik:RadGrid>
I had insert
<EditFormSettings UserControlName="picture.ascx" EditFormType="WebUserControl">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
both
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
       {
        
               e.Item.OwnerTableView.IsItemInserted = false;
               e.Item.OwnerTableView.EditFormSettings.UserControlName = "picture.ascx";
            
       }

But it doesn't work. What 's wrong ??? or I missed anything ??? I had read:
+ http://www.telerik.com/help/aspnet-ajax/grdcustomeditforms.html
+http://www.telerik.com/help/aspnet-ajax/grddifferenteditformsoneditandinsert.html
and demo http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx
But I don't still understand . Because I don't need bind data from grid to webusercontrol. Thanks a lot !!!
Dheeraj
Top achievements
Rank 1
 answered on 03 Dec 2010
1 answer
36 views

Hi All,

I have a radchart (having drill-down feature), once user clicks the bars, the 2nd chart gets open with refined data.
My need is that, on click of the 2nd chart's series or seriesItem or legends  user need to reach again to top chart.

I know through legends, but how can i tackle when user clicks series/seriesItem.

Velin
Telerik team
 answered on 03 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
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?