Change Column Headers programatically, but not work

5 replies. Last post: June 20, 2011 5:53 AM by Riendy Setiadi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Roger ChenMember

in webgrid PrepareDataBinding event(WebGrid version is 6.0.7200.220),

 if (grid.IsFlyPostBack)
            {
                string hid_type = Request.Form["hid_type"];

                if (string.IsNullOrEmpty(hid_type))
                    hid_type = "0";

                if (hid_type == "0") 
                {
                    grid.RootTable.Columns.GetNamedItem("f_code").Caption = "ISBN Code";
                }
                else
                {
                    grid.RootTable.Columns.GetNamedItem("f_code").Caption = "Book Code";
                }
            }

 client code is

 function ViewByType(type, thisControl) {
            var grid = ISGetObject("grid");

            document.all["hid_type"].value = type;

            thisControl.className = "HoverLinkSelected";

            if (type == '0') {
                document.getElementById("type_criterion").className = "HoverLinkNormalFontSize";
            }
            else {
                document.getElementById("type_book").className = "HoverLinkNormalFontSize";
            }

            grid.Refresh();
        }	

server code run ok, but in page, the caption not change, why?

 

thanks

All times are GMT -5. The time now is 9:07 AM.
Previous Next