Hi,
Thank you for reply. I am wondering is it possible to change image url on "Save" button on GridWeb to something like "Close" button. if yes then please let me know how ? I have a requirement to add a close button like functionality to the gridweb. I tried to implement customcommandbutton but it didnt work for me.
Thanks in advance
Hi,
Thank you for reply. I have 2 more questions
1. I have added a CustomCommandButton using following code. But it renders differently than inbuilt buttons. Is there any property I can set to give it same look and feel (without outer border) ? I have attached the image where Close button has outer border but left and right arrow does not have any.
CustomCommandButton button = new CustomCommandButton();
button.ImageUrl = "acw_client/x.gif";
//button.ClientClickEvent = "closeTemplate";
button.ToolTip = "Close";
GridWeb1.CustomCommandButtons.Add(button);
2. Is there any way I can change tooltip of existing button. For example "Submit button should show "Save and Close" instead of "Submit edit and run formula..."
Thanks
Hi,
1) Well, this is behavior of GridWeb’s custom command buttons and they will show borders by default as per your screen shot.
2) GridWeb control provides a property named “ACWLanguageFileUrl” to specify the language file (default is /acw_client/lang_en.js) in /acw_client. I think you may try to create your own .js file similar to “lang_en.js”. Put the lang file into /acw_client/ and set “ACWLanguageFileUrl” property accordingly. You got to customize the strings in “tips of buttons” accordingly at the bottom of the file.
Thank you.
Hi,
Thanks for reply. I have javacript for custom command button between head section but it does not get execute when i click the button. I want to redirect to somewhere else on click of the custom button.
<head>
<script >
function closeTemplate() {
window.location.href = "/Template/Templates";
}
</script>
</head>
<body>
<div>
<form id="template" runat="server">
<acw:GridWeb ID="GridWeb1" runat="server" Width="100%" Height="100%" ></acw:GridWeb>
</form>
</div>
....
This is how I created command button in aspx.cs file and attaching javascript function on button's ClientClickEvent()
CustomCommandButton button = new CustomCommandButton();
button.ImageUrl = "acw_client/x.gif";
button.Text = "Close";
button.Width = 100;
button.ClientClickEvent = "closeTemplate";
button.ToolTip = "Close";
GridWeb1.CustomCommandButtons.Add(button);
Is there anything wrong in function or how can i make it work? Please help.
Thanks
Hi,
Well, I tested your code segment and the closeTemplate client side function is executing fine after clicking the custom command button “Close”. For testing, I add a line to the event handler to your code segment and it executes fine:
e.g
Sample code:
…
…
You may try it to confirm if the event handler is executing or not.
Thank you.