.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Asad Ali
Post New Web Links

Problem in Teleric Grid

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net
 
Hi friends,
      I wants to use teleric grid in my project. I use GetRoleInfo()
 method for display data in grid. But this method is not invoke from grid.
Please help me. How to call this method for display data in grid. I also use 
Another Json method for Edit and Delete.
Here my source code,
Controller : 
using TIS.Security.ServiceProjet;
using System.ComponentModel.DataAnnotations;

namespace TelerikMvcApplicationPract.Controllers
{
    public class RoleController : Controller
    {
        RoleManagerService rms = new RoleManagerService();
        public ActionResult Index()
        {
            return View();
        }

        [GridAction]
        public JsonResult GetRoleInfo()
        {
            IList<RoleService> rs = rms.GetRoles();
            return Json(new GridModel(rs));
        }
    }
}

View : 
@(Html.Telerik().Grid<TIS.Security.ServiceProjet.RoleService>()
        .Name("Grid")
        .DataKeys(k => k.Add(o => o.RoleID))
        .Columns(columns =>
        {
            columns.Bound(o => o.RoleID).Title("RoleID");
            columns.Bound(o => o.RoleName).Title("RoleName");
            columns.Bound(o => o.IsActive).Title("IsActive");
           
        })
        .DataBinding(dataBinding => dataBinding.Ajax()
                                                    .Select("GetRoleInfo", "Role")
 


View Complete Post


More Related Resource Links

ASP.NET Grid View Paging and GridDataRowBound Problem -

  

Hi,

I have a problem displaying data in a Grid View control when I set a row to visible = false when a certain condition is true.

For example, if a DataRowData value has a condition set to true (custom in table) I set the visible property to false, so the data row will not be visible at run time.

The problem is that I'm using paging (10 rows per page) and if 8 of those rows fall into the true condition that won't show the row, that grid view page will only show two rows of data in page 1. The worst scenario is that if I go to page 2 of the grid view and all the rows (10) fall into the true condition, that grid view page will not show any data at all.

How can I show 10 rows of data at all times in a gridview? In other words, I would like to just show the visible rows at all times.

Any help will be greatly appreciated.

Eduardo.


grid view image delete problem

  
i have a grid in which i am showing a record with image, when user delete the record the image also deleted and when it again enter the record it upload the new image but display the deleted image from the cache example: name.jpeg upload, then deleted, a different file with the name.jpeg upload, it showing the deleted one. 

Grid view delete problem

  
i hav a problem with delete in gridview.my backend is oracle 10g.it throws a ORA-01036 exception when i press delete button.here's my link to code. using System; using System.Collections; using System.Configuration; using System.Data; using System.Data.Odbc; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.OracleClient; public partial class Default2 : System.Web.UI.Page { OracleConnection con = new OracleConnection("Data Source=XE;User ID=SYSTEM;Password=****;Unicode=True"); OracleCommand cmd; DataSet ds = new DataSet(); OracleDataAdapter oda; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { getdata(); } } protected void Button1_Click(object sender, EventArgs e) { cmd = new OracleCommand("insert into petitioner values("+ TextBox6.Text +",'"+ TextBox1.Text +"',"+ TextBox2.Text +","+ TextBox3.Text +","+ TextBox4.Text +","+ TextBox5.Text +")", con); cmd.Connection.Open(); cmd.ExecuteNonQuery(); cmd.Connection.Close(); getdata();

Grid view control problem

  
HiI am using the grid view control where i am using <asp:CommandField for editing & deleting i want to visible false of this coloumn with edit & delete button..how do this.Thanks<asp:GridView DataKeyNames="StaffCalendarId"  PagerSettings-Mode="NumericFirstLast"                                                        PagerStyle-HorizontalAlign="Center" ShowHeader="true" AllowPaging="true" AutoGenerateColumns="False"                                                        Width="100%" ID="gvEventInfo" runat="server" CellPadding="4" ForeColor="#333333"                            &nbs

problem showing limited characters in grid view

  
Hi,Is it possible to show only few characters in gridview column. Lets say there are 5 columns in the gridview and one of the field is the description field. assume description field is too long. So What i want is to show that description field value to 50 character limit.my code is like this: <asp:BoundField DataField="ProposalDescription" HeaderStyle-CssClass="endTime" HeaderText="Proposal Description" ItemStyle-CssClass="endTime"> <HeaderStyle CssClass="endTime" /> <ItemStyle CssClass="endTime" /> </asp:BoundField> Now here i want to insert character limit for this datafield. Is it possible ?

Problem of data grid view of xml file

  
Dear Friends I have a problem with XML View Data Grid. Earlier I create .xml file, then type first set of data tags then Right Click on it and select View Data Grid and Visual Studio 2005 gives me nice data grid view where I can able to enter data. But in Visual Studio 2008 I am not able to find that option. So friends kindly tell me how to enter data with data grid in xml file? I am using ASP.net with  C#, Visual Studio 2008, XML file for createing data source. Thank you.

Grid view event problem

  

i call a sql

  SELECT (a.LASTMSG-a.MODIFIED) as mydate FROM DOC a

if


mydate <30   grid 1 color is red

mydate <45  grid 1 color is blue

mydate <450   grid 1 color is blue

it is apply on grid coloum how do it


problem in selecting deslecting multiple records in grid view by clicking control key.plz help

  

i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
    
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        alert(cellid);
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            //alert(ctrlPressed);
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {
                document.getElementById(clearCellColor[i]).bgCol

problem in selecting deslecting multiple records in grid view by clicking control key through java

  

i want to select/deselect multiple records inside grid view by clicking control key.I can do the selection but the deselection is not working properly..there is some thing wrong in the  logic.plz help me to solve the problem.

my java script function is like..

<script language="javascript" type="text/javascript">

    function FillColor(cellid, id, evt) {
    
        var isSelected = document.getElementById('<%=hidSelectedRow.ClientID%>');
        alert(cellid);
        if (!evt) var evt = window.event;
        ctrlPressed = evt.ctrlKey;
        if (!ctrlPressed) {
            //alert(ctrlPressed);
            var clearCellColor = document.getElementById('hidCellId').value.split(',');
            for (i = 0; i < clearCellColor.length; i++) {
                document.getElementById(clearCellColor[i]).bgC

Grid view update problem in asp.net c#

  

Here is my complete code.....please tel where is the problem as i want to update the row in gridview.....and my textbox txtBox1,txtBox2,txtBox3 are having null .........and i'm getting error on the line SqlCommand cmd = new SqlCommand("update product set prodname = '" + txtBox2.Text + "' , proddesc = '" + txtBox3.Text + "' where prodid = " + txtBox1.Text + "", conn); saying that 

 

Object reference not set to an instance of an object.



public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnadd_Click(object sender, EventArgs e)
    {
        
        string pname=txtprodname.Text;
        string pdesc=txtdesc.Text;
        SqlConnection conn = new SqlConnection("Data Source=ABC-59236A7CB6F;Initial Catalog=practical2;Integrated Security=True");
        conn.Open();
         SqlCo

hi problem with grid paging when grid is placed in ajax model popup extender

  

hi i had one ajax tab containeer.in that i placed a grid on click of the grid i am showing another grid which has pagination in a popup. the popup grid has the pagination(custom) which iam showing prev and next button in middle drop downlist the code is as fllows

<PagerTemplate>

<asp:ImageButton ID="imgbtnOPrev" runat="server" CommandArgument="prev" CommandName="Page"

 ImageUrl="~/Images/prev.gif" OnCommand="imgbtnOPre

Grid view width problem

  

how to fix grid view width using jqery


Problem with viewing grid with linked tables

  

Hello,

My grid doesn't show on the web form when I configure its datasource to access the link table and display data from the receiver table. Both link and receiver tables are associated/linked in the .dml file. Any ideas why the grid doesn't show on the form?

Thanks,

Victor


Grid view Problem

  

i am create a user control for grid view i pass sqL string to main (aspx page) and that show the grid view sql in ascx page how to do it


Problem in Nested grid view edit.

  


Hi All ,

I have Parent grid view (gvServiceDetail)  and child grid view (Gridview2) in Parent grid view. Child grid view has 3 bound column. In Parent grid view I am binding Partnername,Area,Mobile and in child grid I am binding services against partnerid.

Now I want to edit service details row in child grid view.

<asp:GridView ID="gvServiceDetail" runat="server" AutoGenerateColumns="False" Width="90%"
                                        DataKeyNames="Partner_code">
                                        <Columns>
                                            <asp:BoundField DataField="NAME_OF_PARTNER" HeaderText="Partner Name" />
                                            <asp:BoundField DataField="Partner_CODE" HeaderText="PartnerId" Visible="false" />
                                            <asp:BoundField DataField="Area_NAME" HeaderText="Area" 
                                                HeaderStyle-Width="25%" >
                                                <HeaderStyle Width="25%" />
                                            </asp:BoundField>
                                            <asp:BoundField 

Problem with resizing images and padding them to squared images before binding them to grid

  

Hi,

I am developing a web application in ASP.NET and C# using Visual Studio 2008. The application will among other thing store images into a database in the original format and in some resized formats. I have this method that takes an image as argument and returns an image with the specified size:

thumbnailmage = ResizeImage(originalImage, new Size(50,50));

The image returned is proportional to the original image with no side bigger than 50 pixels. E.g. if the originalImage has width 100 and height 200 the resized image has width 25 and height 50. This result is expected and wanted.

Now, to what I really want. I want to modify the ResizeImage method to return a squared thumbnail. I.e. in the originalImage example sizes above, the returned image should have width width and heigth both 50. Also, the image should not be stretched but padded with 12.5 pixels on the left and right side making the width 50. The image format I currently work with is gif with transparent background so the padded image parts should also be tansparent. Here is the code for ResizeImage, does anyone know how it could be modified?

  private static Image ResizeImage(Image imageToResize, Size size)
    {
      int sourceWidth = imageToResize.Width;
      int sourceHeight = imageToResize.Height;

      

Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

  
I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

.Surrounding your Data Table and Dialog Controls with ComponentArt Styled Panels
.Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls
The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend