Disable contextual tabs MS Word 2010 - vba

Is it possible to disable contextual tabs in MS Word using CustomUI xml?
I added the following to customui XML but without any effect
<mso:contextualTabs>
<mso:tabSet idMso="TabSetSmartArtTools" visible="false" />
<mso:tabSet idMso="TabSetChartTools" visible="false" />
<mso:tabSet idMso="TabSetTextBoxTools" visible="false" />
<mso:tabSet idMso="TabSetDrawingTools" visible="false" />
<mso:tabSet idMso="TabSetDrawingToolsClassic" visible="false" />
<mso:tabSet idMso="TabSetWordArtTools" visible="false" />
<mso:tabSet idMso="TabSetDiagramTools" visible="false" />
<mso:tabSet idMso="TabSetOrganizationChartTools" visible="false" />
<mso:tabSet idMso="TabSetPictureTools" visible="false" />
<mso:tabSet idMso="TabSetPictureToolsClassic" visible="false" />
<mso:tabSet idMso="TabSetTableTools" visible="false" />
<mso:tabSet idMso="TabSetHeaderAndFooterTools" visible="false" />
<mso:tabSet idMso="TabSetEquationTools" visible="false" />
<mso:tabSet idMso="TabSetInkTools" visible="false" />
</mso:contextualTabs>

You can either try to use the getVisible property. See MSDN
<mso:tabSet idMso="TabSetSmartArtTools" getVisible="false" />
Or try to start from scratch. See here

Related

Create hyperlink in GridViewDataTextColumn VB.NET

<dx:GridViewDataTextColumn FieldName="bookno" VisibleIndex="1" Caption="Book No."
Width="15%">
<EditFormSettings Visible="False" />
<HeaderStyle HorizontalAlign="Center" Wrap="True" />
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" />
<Settings AutoFilterCondition="Contains" FilterMode="DisplayText"></Settings>
<PropertiesTextEdit MaxLength="50" Width="400px" ClientInstanceName="txtName">
<ValidationSettings>
<RequiredField IsRequired="true" ErrorText="Kode Harus Diisi" />
</ValidationSettings>
<ClientSideEvents KeyUp="MakeUpperCase" />
</PropertiesTextEdit>
</dx:GridViewDataTextColumn>
how do i make it as hyperlink? should I create a new function?..................................................

move AccessDataSource to code behind in vb

Looking to convert dozens of pages from aspx AccessDataSource to vb.net code behind. I'm using OleDB and ADO on other pages. wanted to know if there is any canned code to bind a simple select statement to the GridView1
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="AccessDataSource1" BackColor="White" BorderColor="#999999"
BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black"
GridLines="Vertical" AllowSorting="True">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="RowLevelCheckBox" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UsersDataTbl.LastName" HeaderText="Last Name" SortExpression="LastName" />
<asp:BoundField DataField="UsersDataTbl.FirstName" HeaderText="First Name" SortExpression="FirstName" />
<asp:BoundField DataField="UsersDataTbl.Affiliation" HeaderText="Affiliation" SortExpression="Affiliation" />
<asp:BoundField DataField="UsersDataTbl.UID" HeaderText="UID" SortExpression="UID" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#6699CC" />
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="<%$ ConnectionStrings:AccessSubSiteString %>"
SelectCommand="SELECT [UsersDataTbl.LastName], [UsersDataTbl.FirstName], [UsersDataTbl.Affiliation], [UsersDataTbl.UID], [ALSProviders.ALS]
FROM [UsersDataTbl] LEFT JOIN [ALSProviders] ON (UsersDataTbl.UID = ALSProviders.UID) WHERE [UsersDataTbl.Career] = True
AND [UsersDataTbl.Active] = True AND ([UsersDataTbl.UID] NOT IN (SELECT UID FROM [ALSProviders]))
ORDER BY [UsersDataTbl.LastName]" >
<SelectParameters>
</SelectParameters>
</asp:AccessDataSource>

Why isn't my GridView updating?

I'm trying to update the 'question' field when I hit the 'update' button for a specific row. I am able to change the text when I hit the 'edit' button, but when I hit the 'update' button it reverts back to its original value. Nothing is changed in the database either.
Here is my markup:
<div class="divGrid" style="margin: 0 auto; width: 70%;">
<asp:GridView ID="QuestionsGridView" CssClass="gridView" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="100%" CellPadding="4" ForeColor="#333333">
<Columns>
<asp:BoundField DataField="QUESTION_NUMBER" ReadOnly="true" HeaderText="Question Number" SortExpression="QUESTION_NUMBER" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Question" SortExpression="QUESTION" HeaderStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:TextBox ID="EditQuestionBox" runat="server" Height="50px" Text='<%# Bind("QUESTION") %>' TextMode="MultiLine" Width="99%" CssClass="multilineTBox" Columns="1" Rows="2"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("QUESTION") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="99%" />
</asp:TemplateField>
<asp:BoundField DataField="CAT_NAME" ReadOnly="true" HeaderText="Category" SortExpression="CAT_NAME" HeaderStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="QUES_ORDER" ReadOnly="true" HeaderText="Order in Category" SortExpression="QUES_ORDER" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" />
<asp:CommandField CausesValidation="False" HeaderText="Edit" ShowEditButton="True" ControlStyle-Width="4em" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" />
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#a0a0a0" Font-Bold="True" ForeColor="White" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px" HorizontalAlign="Center" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Corp_TaxConnectionString %>"
SelectCommand="SELECT tq.id, tq.question, tq.ques_order, tc.cat_name, tq.question_number FROM t01_tax_questions AS tq INNER JOIN t01_tax_categories AS tc ON tq.category = tc.cat_order ORDER BY tq.question_number"
UpdateCommand="UPDATE t01_tax_questions SET question = #question WHERE question_number = #question_number">
<UpdateParameters>
<asp:Parameter Name="question_number" Type="Int32" />
<asp:Parameter Name="question" Type="String" />
<asp:Parameter Name="id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
And the table:
SQLServer Table
EDIT:
After looking, in my EditItemTemplate, I bind the question to the textbox. Is it possible that after I click the update button that the original question is databound to the textbox again before it tries to update? If this is the case, how would I get around that?
After looking further into it, I realized I had forgotten the apparently very important "DataKeyNames" attribute in my GridView tag. I feel really dumb. Here is the new working code.
<div class="divGrid" style="margin: 0 auto; width: 70%;">
<asp:GridView ID="QuestionsGridView" CssClass="gridView" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="ID, QUESTION_NUMBER" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="question_number" HeaderText="Question Number" SortExpression="question_number" ReadOnly="True" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="question" HeaderText="Question" SortExpression="question" >
<ControlStyle Width="100%" Height="80%" />
</asp:BoundField>
<asp:BoundField DataField="cat_name" HeaderText="Category" SortExpression="cat_name" ItemStyle-HorizontalAlign="Center">
<ControlStyle Height="80%" />
</asp:BoundField>
<asp:BoundField DataField="ques_order" HeaderText="Question Order" SortExpression="ques_order" ReadOnly="True" ItemStyle-HorizontalAlign="Center" />
<asp:CommandField HeaderText="Edit" ShowEditButton="True" CausesValidation="False" HeaderStyle-Width="4%" ItemStyle-HorizontalAlign="Center"/>
<asp:CommandField HeaderText="Delete" ShowDeleteButton="True" CausesValidation="False" HeaderStyle-Width ="4%" ItemStyle-HorizontalAlign="Center" />
</Columns>
<EditRowStyle BackColor="Yellow" Width="100%" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#a0a0a0" Font-Bold="True" ForeColor="White" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px" HorizontalAlign="Center" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#ffffff" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Corp_TaxConnectionString %>" SelectCommand="SELECT
tq.id, tq.question_number, tq.question, tc.cat_name, tq.ques_order
FROM
t01_tax_questions AS tq
INNER JOIN
t01_tax_categories AS tc
ON
tq.category = tc.cat_order
ORDER BY tq.question_number"
DeleteCommand="DELETE
FROM
t01_tax_questions
WHERE
question_number = #question_number"
UpdateCommand="UPDATE
t01_tax_questions
SET
question = #question
WHERE
id = #id">
<DeleteParameters>
<asp:Parameter Name="#question_number" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="#question"/>
<asp:Parameter Name="#id" />
</UpdateParameters>
</asp:SqlDataSource>
It is all explained in this MSDN Documentation
Thank you to all who looked at this and tried.

How to find average of two gridviews in sql vb.net

I have two GridView1 and GridView2 which give a numerical values I want to create another Gridview3 or functionality that can generate the average of both the values of the existing Gridview1 & GridView2 i.e. GridView3=(GridView1+GridView2)/2
How should I write the SQL statement for it.
This is my GridView code in aspx
<asp:GridView ID="GridView7" runat="server" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataSourceID="SqlDataSource9" ForeColor="Black" GridLines="None">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<Columns>
<asp:BoundField DataField="mean_POLQA_score" HeaderText="mean_POLQA_score" ReadOnly="True" SortExpression="mean_POLQA_score" />
</Columns>
<FooterStyle BackColor="Tan" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<SortedAscendingCellStyle BackColor="#FAFAE7" />
<SortedAscendingHeaderStyle BackColor="#DAC09E" />
<SortedDescendingCellStyle BackColor="#E1DB9C" />
<SortedDescendingHeaderStyle BackColor="#C2A47B" />
</asp:GridView>
The SQL queries are as follows
SELECT ROUND(AVG(POLQA_Score),3) AS mean_POLQA_score FROM VQTPOLQA WHERE VQT_Timestamp BETWEEN ? AND ? AND VQuad_PhoneID =?
SELECT ROUND(AVG(POLQA_Score),3) AS mean_POLQA_score1 FROM VQTPOLQA WHERE VQT_Timestamp BETWEEN ? AND ? AND VQuad_PhoneID =?

Disable Download Link in Gridview when no filename is available

I'm a newbie, but need some assistance. I have researched the request but only found one response, which looks like it can be done, but I'm not sure how to do it physically in vb and VS2010.
Basically, I have a webgrid with a download link along with a filename. I want the download link to be disabled if there is no filename as there is nothing to download (obviosuly).
This resolution I found was this - Here - However, don't really follow it, specifically because im doing it in vb too.
Any assistance on this would be great.
Thanks
My code for the gridview.
<asp:GridView ID="SearchErrorGridView" runat="server" AutoGenerateColumns="False" AllowPaging="True"
AllowSorting="True" DataKeyNames="FileName" DataSourceID="SearchHelpDeskErrorMessages"
PageSize="10" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
EmptyDataText="No Applicable Data" SelectedRowStyle-BackColor="#99CCFF">
<AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
<Columns>
<asp:BoundField DataField="RequestID" HeaderText="RequestID" ReadOnly="True" SortExpression="RequestID" />
<asp:BoundField DataField="Name" HeaderText="Client Name" SortExpression="Name" />
<asp:BoundField DataField="EmpName" HeaderText="Employee Name" SortExpression="EmpName" />
<asp:BoundField DataField="Module" HeaderText="Module" SortExpression="Module" />
<asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />
<asp:BoundField DataField="ErrorMessage" HeaderText="Error Message" SortExpression="Error Message" />
<asp:BoundField DataField="ShortDescription" HeaderText="ShortDescription" SortExpression="ShortDescription" />
<asp:BoundField DataField="Resolution" HeaderText="Resolution" SortExpression="Resolution" />
<asp:BoundField DataField="DateOfCall" HeaderText="Date Of Call" SortExpression="DateOfCall" />
<asp:BoundField DataField="FileName" HeaderText="File Name" />
<asp:TemplateField HeaderText="File Download">
<ItemTemplate>
<asp:LinkButton ID="lnkDownload" runat="server" Text="Download" OnClick="lnkDownload_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField CommandName="Select" Text="Select" />
</Columns>
<EmptyDataRowStyle CssClass="mGrid" />
<PagerStyle CssClass="pgr"></PagerStyle>
</asp:GridView>