Friday, March 14, 2014

Visual studio customization for enterprise portal

get particular table field value in visual studio
<dynamics:AxGroup ID="AxFieldGroupDefaultsProject" runat="server"
                    Caption="<%$ AxLabel:@SYS4534 %>">
                <Fields>
                    <dynamics:AxBoundField DataSet="TrvExpTableNew"DataSetView="TrvExpTable"
                        DataField="ProjId" SortExpression="ProjId" AutoPostBack="true" OnDataChanged="ProjId_OnDataChanged"/>
                </Fields>
            </dynamics:AxGroup>
While adding the bound fields to the AxForm, we won’t get this attributeAutoPostBack="true" to the AxBoundField.
To raise the OnDataChanged event explicitly need to add the above attribute toAxBoundField.
Then I had added the following code to the event …
protected void ProjId_OnDataChanged(object sender,AxBoundFieldDataChangedEventArgs e)
    {
        string expProjId = ((System.Web.UI.WebControls.TextBox)(e.BoundControl)).Text.ToString();

                if (expProjId != "")
                {
                    ButtonOK.Enabled = true;
                }
                else
                {
                    ButtonOK.Enabled = false;
                }          
    }

No comments:

Post a Comment