ButtonColumn text in datagrid

I want to change the text link on a buttoncolumn dynamically for a multi language site. Problem is I cant see how to access the object. I can change the Headertext using DG1.Columns.Item(3).HeaderText, but there is no text property for the buttoncolumn.<BR><BR>Thanks<BR><BR>Gazza&nbsp;<BR>If the Text property is set in the HTML <BR>just set the Text=<% # MyTextVariable %> and on PageLoad (or any function that bind your detail to the grid) ,initialize the variable with the value.<BR><BR>you can also bind the caption of the button to the DataTextField <BR>ex: DataTextField="LastName" (representing a binded field )<BR><BR><asp:ButtonColumn Buttontype="LinkedButton" DataTextField="LastName" DataTextFormatString="{0}" ....<BR><BR>the DataTextFormatString ={0} will replace its placeHolder {0} by the field pointed by DataTextField.<BR><BR>so let say you have differente language selection and the schema returned by the SQL query remains the same, the button will always take the LastName value for each row.just set the Text=<% # MyTextVariable %> and on PageLoad (or any function that bind your detail to the grid) ,initialize the variable with the value.<BR><BR>The above does not work...I get the error:<BR>"Compiler Error Message: BC30676: 'DataBinding' is not an event of 'System.Web.UI.WebControls.ButtonColumn'."<BR><BR>Your alternate offering is a non-starter for this.<BR><BR>Any other ideas<BR><BR>did you try to add quotes to Text=<% # MyTextVariable %> <BR>Text='<% # MyTextVariable %>'Yeh I tried that but made no difference.<BR><BR>?<BR><BR>GazConvert the column to a template column and you get access to the text property of the linkbutton. You have to loop through each occurance (row) to change the text.<BR><BR>Gaz
 
Back
Top